I was trying to answer an issue with custom drop down, but challenged by an inconsistent behavior in Chrome and Firefox.
DEMO: http://jsfiddle.net/fyeht/ [Added scroll event for more clarity]
See below image, The list items can be navigated using arrow keys.
To Reproduce the issue:
- Open console in Chrome (F12)
- Click on an item in the list (you would notice some events getting logged in the console)
- Use down arrow key to navigate to the next item in the list
- Finally, the issue is noticed when you reach the last item in the view and hitting down arrow would scroll. Check the log to see 'scroll', 'mouse enter' and 'mouse move' [check the new demo]
The issue is after reaching the end of items in view, it scrolls. Even though the mouse is untouched, it triggers mouseenter
and mousemove
events in Chrome. In FF, on scroll it triggers just the mouseenter
which make sense.
Question(s):
- Why is
mousemove
triggered when mouse is untouched? - Is this just browser inconsistency? Could not find documentation on events triggered when scrolling? (never knew it did)
Submitted a bug report: https://code.google.com/p/chromium/issues/detail?id=241476