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

EuiComboBox - onBlur callback is invoked when the element focused #1736

Closed
maryia-lapata opened this issue Mar 18, 2019 · 7 comments
Closed
Labels

Comments

@maryia-lapata
Copy link
Contributor

EuiComboBox's onBlur event doesn’t seem to work correctly. OnBlur callback is invoked when input tag misses the focus, where input tag is 2 px wide, when nothing was typed. So when I click on empty or filled combo, onBlur event is triggered, and it'd difficult to handle properly when EuiComboBox is touched in the form.

 1

@chandlerprall
Copy link
Contributor

chandlerprall commented Mar 18, 2019

What do you want to trigger via onBlur? It was a recent addition to the component with the intention to be used very sparingly, it's likely your use case is covered by another feature.

For sure though, there is a bug causing onBlur to fire and completely inappropriate times (as your gif definitely shows). However, cleaning up that bug doesn't completely remove the unintuitiveness of when onBlur fires, e.g. clicking to select on option triggers the onBlur edit: no longer the case, given the proposed PR

@chandlerprall
Copy link
Contributor

@zumwalt was there a necessity in #1400 to have the onBlur prop trigger when explicitly the combo box input loses focus vs. the whole combo box component?

@zumwalt
Copy link
Contributor

zumwalt commented Mar 18, 2019

Input seemed to make sense at the time, but the primary goal of that PR was to expose onBlur — if the event is triggered by the input's parent element, that should work for us as well. A change here shouldn't break anything for us.

@maryia-lapata
Copy link
Contributor Author

@chandlerprall I suppose that onBlur event will be triggered when the whole EUIComboBox component loses focus, rather than only the input tag inside the EUIComboBox.

it's likely your use case is covered by another feature

By "another feature" do you mean a feature of EUIComboBox component or some approach not related to EUIComboBox?

@chandlerprall
Copy link
Contributor

I meant by something within EuiComboBox itself - usually the blurring of this component isn't as useful as watching the onChange event. However, #1739 is merged in with the fix for the onBlur callback and we'll get that out soon.

@chandlerprall
Copy link
Contributor

@maryia-lapata the onBlur fix has landed in Kibana master and 7.x branches

@maryia-lapata
Copy link
Contributor Author

@chandlerprall I appreciate it so much. It works like a charm 👍

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

No branches or pull requests

4 participants