Always checked :
- Can Meteor call a method on the server twice if the client gets disconnected?
- OnClick Event gets fired twice
- JavaScript multiple keys pressed at once
- Detect multiple keys on single keypress event in jQuery
- https://therelentlessfrontend.com/2012/11/13/detect-multiple-key-press-in-javascript-for-your-website/
- Prevent JavaScript keydown event from being handled multiple times while held down
- Can Meteor call a method on the server twice if the client gets disconnected?
- https://groups.google.com/forum/#!msg/meteor-talk/j1YF7JO5Rdo/cYHR5kbhC8UJ
Hello,
I have discovered in my database the Meteor Method have been executed several times from click or keypress.
I don't manage to trigger the bug.
Here my code :
class Answering extends Component {
...
validAnswer() {
...
validAnswer.call({
...
});
}
...
render() {
return (
...
<div
id="Answering-button-next"
role="button"
onClick={() => { this.validAnswer(); }}
onKeyPress={(e) => { if (e.key === 'Enter') this.validAnswer(); }}
tabIndex="0"
>OK
</div>
How can fix this bug ?
Thank you