vlad-ignatov/react-numeric-input

Middle / right mouse click on up / down buttons lead to unexpected results on chromium browsers

Opened this issue · 0 comments

When right clicking the component's up / down buttons (which opens the browser's context menu), the button stays pressed and thus frequently increases / decreases the input's value until you close the context menu.

Also when middle mouse clicking the up / down buttons on linux (where middle mouse button does 'insert from clipboard' by default) the text in your clipboard is inserted into the text field.

Tested on the demo page with Firefox, Chrome and Opera => the issue only appears on chromium browsers (Firefox has no issues).

This could be fixed by checking event.which in
onMouseDown and onMouseUp to only allow left mouse button events.