-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Maps] Fix long field truncation on Comboboxes #171829
Conversation
2c9ab60
to
ff83ba6
Compare
94ceba9
to
40503c7
Compare
Pinging @elastic/kibana-presentation (Team:Presentation) |
|
||
if (disabledReason) { | ||
option.prepend = ( | ||
<> |
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.
Does this mean the tooltip is only on prepend icon? Is there any way to keep the tooltip on the entire value? Could renderOption
still be used?
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.
it is not, it happens inside the entire value because of the custom css we place there. It works exactly as before. We cannot use renderOption if we want to take advantage of internal combobox truncation.
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.
How difficult is it to do the truncation in renderOptions? I think its important to keep the tooltip target over the entire text, otherwise, its really difficult to trigger.
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 is how it works, sorry I wasn't clear before. I agree it's important to keep the tooltip target over the entire text and it is kept this way in this PR. Right now it doesn't make sense to do the truncation in renderOption
because the implementation is not straightforward and it's complex (the problem is not truncation but proper selecting text when searching through it). Please take a look at this video:
Screen.Recording.2023-11-28.at.20.38.49.mov
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.
Thanks for clarifying
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.
kibana-gis changes LGTM. Thanks for putting this fix together. Really appreciate it!
code review and tested in chrome
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Fixes #171509 (fixed in all the places in maps)
Adds middle truncation and combobox auto-expansion to the content to approximate of 60 character maximum for
SingleFieldSelect
andFieldSelect
components in maps.I removed custom
renderOption
prop so the combobox can take care of the proper truncation while searching through the fields. One case I had to hack was to display a tooltip for a disabled state. I usedprepend
and some custom styling to do so - it works as before (check out the screenshot below).FieldSelect component before
FieldSelect component after
SingleFieldSelect component before
SingleFieldSelect component after
disabled state