Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent blur event on menu item selection #310

Closed
alasdairhurst opened this issue Feb 16, 2018 · 4 comments
Closed

Inconsistent blur event on menu item selection #310

alasdairhurst opened this issue Feb 16, 2018 · 4 comments

Comments

@alasdairhurst
Copy link
Contributor

Version 2.3.2

Steps to reproduce

Use the following fiddle:
https://jsfiddle.net/alasdairhurst/wtLgga55/5/

Select a suggestion using the keyboard and press enter
Input does not blur on select

Now select a suggestion with the mouse
Input blurs on select

Expected Behavior

A consistent behaviour - blur on both or don't blur on select
Personally, I would be for the latter. I feel that blur should only happen when the input loses focus. A different event is used to check if a menu selection is made/changed.

Actual Behavior

Input blurs inconsistently when using mouse or keyboard for selection

@ericgio
Copy link
Owner

ericgio commented Feb 16, 2018

Makes sense. Note that the underlying reason for the difference in behavior is that clicking on a menu item does actually blur the input, while using keystrokes does not. So in this case I'd need to re-focus the input after a menu item has been clicked.

@alasdairhurst
Copy link
Contributor Author

clicking on a menu item does actually blur the input, while using keystrokes does not

Should it behave like this though? What is the reasoning between the different functionality based on the input controller?

@ericgio
Copy link
Owner

ericgio commented Feb 20, 2018

What is the reasoning between the different functionality

That's just default javascript behavior. So like I said, I either need to re-focus the input or prevent the blur.

@ericgio
Copy link
Owner

ericgio commented Feb 21, 2018

Fixed in v2.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants