Skip to content

Instantly share code, notes, and snippets.

View jmleroy's full-sized avatar

JM Leroy jmleroy

  • Couthuin, Belgium
View GitHub Profile
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
class App extends React.Component {
state = {
elements: [
{ id:1, nom: 'foo' },
$("body.refunds.home.rmcuser #idf").on(
"keypress",
function (e) {
var charCode = (typeof e.which == "undefined") ? e.keyCode : e.which;
var charStr = String.fromCharCode(charCode);
return /\d/.test(charStr) // number
|| e.keyCode == 37 || e.keyCode == 39 // left and right arrows
|| e.keyCode == 36 || e.keyCode == 35 // home and end
|| e.keyCode == 8 || e.keyCode == 46 // backspace and delete
|| (e.ctrlKey && (charStr == 'v' || charStr == 'V')); // paste