From 36bb8b7dc46a96d12d1df9834d02f541aa55c537 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Thu, 12 Oct 2017 11:31:31 +0100 Subject: [PATCH] Fix bug that inserted emoji when typing This was quite simple in the end -- the mouse doens't move, but on some browsers, the autocomplete appearing beneath the mouse would cause the `onMouseOver`, which is not `onMouseMove`. The fix was to use `onMouseMove`. Fixes vector-im/riot-web#4974 --- src/components/views/rooms/Autocomplete.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/rooms/Autocomplete.js b/src/components/views/rooms/Autocomplete.js index beeecf5430..ecc908a02c 100644 --- a/src/components/views/rooms/Autocomplete.js +++ b/src/components/views/rooms/Autocomplete.js @@ -233,7 +233,7 @@ export default class Autocomplete extends React.Component { const componentPosition = position; position++; - const onMouseOver = () => this.setSelection(componentPosition); + const onMouseMove = () => this.setSelection(componentPosition); const onClick = () => { this.setSelection(componentPosition); this.onCompletionClicked(); @@ -243,7 +243,7 @@ export default class Autocomplete extends React.Component { key: i, ref: `completion${position - 1}`, className, - onMouseOver, + onMouseMove, onClick, }); });