downshift version: 1.16.0node version: 8.5.0npm (or yarn) version: yarn 1.0.2In any downshift configuration (at least thus far in my experience), the mouse position will fire (and select whatever is underneath it) immediately after an arrow-selecting and shift-arrow-paging event.
I would expect the cursor to not activate an option while using arrow navigation, unless of course, the cursor is moved.
Code origin is easy to locate: https://github.com/paypal/downshift/blob/master/src/downshift.js#L637, but the solution to this problem could be more difficult than I thought.
Yep, I've seen and experienced this before. Interestingly, Google avoids this problem and hides the cursor:

I think we could do something similar. I definitely welcome a pull request to improve this experience. I think that most folks would prefer this and others wouldn't notice if we changed this.
As for a solution, I'm not 100% certain the best way to do it. Definitely open to ideas.
I'm curious if a mouse move event would fire in the same situation.
That would probably bring some debouncing or cancelling issues to mind, but theoretically would work. I feel there is a simpler solution though...
@kentcdodds @tannerlinsley I'll look at this tonight! I'm also developing similar component for client work so let's see what I can do.
After thinking for a while, I think this could work (theoretically). Here's how:
isArrowButtonClicked for now.componentWillMount, add event listener that binds to onkeyup. If this.state.isOpen and key UP/DOWN is pressed, change this.state.isArrowButtonClicked to true.componentWillMount, add event listener that binds to onmousemove. If this.state.isOpen and this.state.isArrowButtonClicked is true, then change it to falseonMouseEnter event listener on item props if this.state.isArrowButtonClicked is true. https://github.com/paypal/downshift/blob/master/src/downshift.js#L637Love to hear any improvement!
cc: @kentcdodds @tannerlinsley
Thanks for the idea @philipyoungg,
I'm not sure I understand the purpose of the isArrowButtonClicked... Honestly this doesn't appear to have anything to do with whether you click the toggle button or if there's even a toggle button at all...
I think that it would be easier to see solutions to this than hear it explained. Anyone can feel free to open a PR. It may not get merged right away or at all depending on how complicated it is, but that will be much more likely to get merged if it's shown in a PR rather than explained in text :)
@kentcdodds IsArrowButtonClicked is a state that monitors whether user pressed key up / key down while the dropdown is open.
The problem is mouse event fired when user choosing the dropdown item on arrow up / arrow down right?
The only responsibility of the state is to disable the Mouse event when the state is true.
The state will return to false as soon as user moves the Mouse.
Hmmm... the isArrowButtonClicked name just isn't working for me.... But feel free to open a PR and we can talk about it there.
Also, I wonder whether pointer-events could help us here.
/s/isArrowButtonClicked/isArrowButtonPressed
Fingers don't click :)
My 2c, I think part of the naming confusion is because it's not an arrow button, but an arrow key. Button makes web developers think of <button> I think 馃槢.
isArrowKeyPressed?
Thanks @ibrahima. Yes, I do like isArrowKeyPressed better :+1:
Still not sure I follow the suggested solution well, but a PR would help me understand I think.
This was mistakenly closed.
This was solved a while back. Forgot to close the issue.