Option under mouse is focused when scrolling with ArrowUp/Down
See original GitHub issueReplicate by clicking the first select on the demo page, putting your mouse cursor over the first option, and pressing ArrowDown. When you get to the bottom of the visible window and ArrowDown once more, the window scrolls causing the mouseEnter handler to fire on the top option and focus goes from Tasmania (which just scrolled into view) back up to the top option.
They way I’ve seen this handled is to keep a flag that tells whether or not the user is using the keyboard on the component, and then check it in the mouseEnter handler. Would look something like this:
var ex = {
usingKeyboardOn: function() {
if (this.usingKeyboard) { return; }
document.removeEventListener("keydown", this.usingKeyboardOn, true);
document.addEventListener("wheel", this.usingKeyboardOff, true);
document.addEventListener("mousemove", this.usingKeyboardOff, true);
this.usingKeyboard = true;
},
usingKeyboardOff: function() {
if (!this.usingKeyboard) { return; }
document.addEventListener("keydown", this.usingKeyboardOn, true);
document.removeEventListener("wheel", this.usingKeyboardOff, true);
document.removeEventListener("mousemove", this.usingKeyboardOff, true);
this.usingKeyboard = false;
},
handleMouseEnter: function(op) {
if (!this.usingKeyboard) { this.focusOption(op); }
},
}
Issue Analytics
- State:
- Created 9 years ago
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Scroll Inactive Windows by Hovering Over Them - groovyPost
To enable scrolling inactive windows, open Settings > Devices > Mouse & Touchpad. From there toggle on Scroll inactive windows when I hover...
Read more >How to make the scroll wheel to affect always what's under the ...
Select this and look for the option to "Activate a window by hovering over it with the mouse". Now the window under the...
Read more >How to focus to splited screens when moving mouse cursor to ...
Currently the mouse and screen if focused in the splitted screen named as SPLITTED SCREEEN ONE and i have tried to scroll to...
Read more >c++ - Scrolling the Window Under the Mouse - Stack Overflow
And now, the window under your mouse will always get scroll messages, and not the focused window. Share.
Read more >How to Enable Inactive Scrolling on Windows 10 - MakeUseOf
Windows 10 can scroll through windows even if you don't click on them to bring them into focus first. Using a computer mouse....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Is there any update on this? We are seeing this issue as well and it would be nice to get a solution in without having to work around it.
@FossiFoo,
It’s not completed. I got multi selection and simple selection implemented. Simple-value and Async are not implemented. I have not decided yet to open, because different from @JedWatson I have no authority over the code. I’m porting (a lot of work) and I’m gaining confidence and getting to know the design.
regards, geraldodev
2016-10-19 3:42 GMT-02:00 FossiFoo notifications@github.com: