File tree 6 files changed +1487
-1381
lines changed
6 files changed +1487
-1381
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " react-mentions " : minor
3
+ ---
4
+
5
+ Focus suggestions on mouse move instead of mouse enter
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-mentions" ,
3
- "version" : " 4.4 .7" ,
3
+ "version" : " 4.5 .7" ,
4
4
"description" : " React mentions input" ,
5
5
"main" : " dist/react-mentions.cjs.js" ,
6
6
"module" : " dist/react-mentions.esm.js" ,
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ class MentionsInput extends React.Component {
281
281
customSuggestionsContainer = { this . props . customSuggestionsContainer }
282
282
onSelect = { this . addMention }
283
283
onMouseDown = { this . handleSuggestionsMouseDown }
284
- onMouseEnter = { this . handleSuggestionsMouseEnter }
284
+ onMouseMove = { this . handleSuggestionsMouseMove }
285
285
isLoading = { this . isLoading ( ) }
286
286
isOpened = { this . isOpened ( ) }
287
287
ignoreAccents = { this . props . ignoreAccents }
@@ -678,7 +678,7 @@ class MentionsInput extends React.Component {
678
678
this . _suggestionsMouseDown = true
679
679
}
680
680
681
- handleSuggestionsMouseEnter = ( focusIndex ) => {
681
+ handleSuggestionsMouseMove = ( focusIndex ) => {
682
682
this . setState ( {
683
683
focusIndex,
684
684
scrollFocusedIntoView : false ,
Original file line number Diff line number Diff line change @@ -9,15 +9,15 @@ function Suggestion({
9
9
ignoreAccents,
10
10
index,
11
11
onClick,
12
- onMouseEnter ,
12
+ onMouseMove ,
13
13
query,
14
14
renderSuggestion,
15
15
suggestion,
16
16
style,
17
17
className,
18
18
classNames,
19
19
} ) {
20
- const rest = { onClick, onMouseEnter }
20
+ const rest = { onClick, onMouseMove }
21
21
22
22
const renderContent = ( ) => {
23
23
let display = getDisplay ( )
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function SuggestionsOverlay({
26
26
style,
27
27
customSuggestionsContainer,
28
28
onMouseDown,
29
- onMouseEnter ,
29
+ onMouseMove ,
30
30
} ) {
31
31
const [ ulElement , setUlElement ] = useState ( )
32
32
@@ -85,7 +85,7 @@ function SuggestionsOverlay({
85
85
suggestion = { result }
86
86
focused = { isFocused }
87
87
onClick = { ( ) => select ( result , queryInfo ) }
88
- onMouseEnter = { ( ) => handleMouseEnter ( index ) }
88
+ onMouseMove = { ( ) => handleMouseMove ( index ) }
89
89
/>
90
90
)
91
91
}
@@ -98,9 +98,9 @@ function SuggestionsOverlay({
98
98
return < LoadingIndicator style = { style ( 'loadingIndicator' ) } />
99
99
}
100
100
101
- const handleMouseEnter = ( index , ev ) => {
102
- if ( onMouseEnter ) {
103
- onMouseEnter ( index )
101
+ const handleMouseMove = ( index , ev ) => {
102
+ if ( onMouseMove ) {
103
+ onMouseMove ( index )
104
104
}
105
105
}
106
106
You can’t perform that action at this time.
0 commit comments