-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Add iconType
and disableLanguageSwitcher
options to QueryStringInput
#83700
Conversation
Pinging @elastic/kibana-app-arch (Team:AppArch) |
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.
Did a quick code review. Thanks for adding to the docs and the gifs. Reasoning looks sound. Small comments.
...ment/plugins/data/public/kibana-plugin-plugins-data-public.querystringinputprops.icontype.md
Show resolved
Hide resolved
...ta/public/kibana-plugin-plugins-data-public.querystringinputprops.disablelanguageswitcher.md
Show resolved
Hide resolved
@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.
Looks great!
I just wonder if we shouldn't make the icon visible everywhere, rather than have it configurable.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
I'd keep it off by default. There's already a lot of icons around in the default and the placeholder gives context. |
…nput` (#83700) (#84097) * Add iconType and disableLanguageSwitcher options to QueryStringInput * Remove unnecessary span, add tests * Update docs * Adjust suggestions offset * Add comment Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Summary
This PR adds new props to
QueryStringInput
component:iconType: string
to show an icon in front of the input fielddisableLanguageSwitcher: boolean
to hide the language switcher at the end of the input fieldBoth new props are optional. Default behavior of the component is not changed (no icon, and visible language switcher).
I had to make some border styling adjustments to maintain the border when there is multiline input but not show a right-side border when language switcher is disabled. The previous styling had a
translateX(-1)
on the input, so the right-side border was always visible. With these changes, that transform was removed, but the border styling differs minimally from the original implementation in #70140.The use case for these props came up in #83356, where we implemented a feature that requires a query bar with suggestions that is locked to KQL and design spec included a search icon be present.
HQ screenshots to compare styling: with icon and language switcher present to illustrate input boundaries
Low quality gifs showing behavior
With icon and language switcher disabled:
With only icon:
With only language switcher disabled:
Default behavior:
Checklist