-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[Data UI] [Fleet] Add submitOnBlur functionality to QueryStringInput #93819
[Data UI] [Fleet] Add submitOnBlur functionality to QueryStringInput #93819
Conversation
Pinging @elastic/kibana-app-services (Team:AppServices) |
Pinging @elastic/fleet (Team:Fleet) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM
I worked on some bugfixes in that area and in pending pr adding a hook where I think, submitOnBlur
will be ideal: https://github.com/elastic/kibana/pull/94148/files#diff-9c21b61183abad2b8d078185afa822ec12ff2237a3dfe9b0bf09880028528f39R514-R518
I also unskipped tests of that component, so it would be possible to add a test here.
If it is not time pressing, we could wait a bit with this pr until #94148 goes through.
Up to you. Otherwise, I'll merge master and will likely move that handler into the new scheduleOnInputBlur
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fleet changes 🚀 it works as expected
💚 Build SucceededMetrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: cc @Zacqary |
…lastic#93819) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
Fixes an issue identified in #92853 (comment)
This adds a prop called
submitOnBlur
to theQueryStringInput
component. Whentrue
, the component will trigger itsonSubmit
event when the user clicks or tabs away from the component, instead of requiring them to press Enter to make it happen.Note that this doesn't simply rely on the base
onBlur
function, as using the mouse to interact with the autocomplete dropdown will momentarily triggeronBlur
. Instead, it waits 200ms to make sure the query string<textarea>
element has not been re-focused, to ensure that theonBlur
was actually the result of an intentional user blur of the element.API Docs are updated by this PR. This is a minor change.