You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[EuiComboBox] Allow dropdown to expand to not truncate options #2082
react-virtualized requires the width prop to be set, will not auto-expand to fit content
EuiComboBox is designed to size up to but not exceeding 400px. This governed by CSS.
The options' widths are set to fill the parent's space.
Options auto-truncate via CSS
Solution requirements
provide an exact width to react-virtualized
compute options' widths apart from the DOM values (can't inspect an element's clientWidth, for example)
update combobox CSS and JS to support both implementations
Proof of concept
I don't particularly like this approach, but wasn't able to come up with anything different. I also didn't try to reconcile the current max-width: 400px with the new setup, instead forcing all dropdowns to auto-fit their contents.
Measure rendered width of labels when the dropdown expands
allows options to be dynamic
waits for CSS to be downloaded/applied, important for including the correct font style
All browsers (only tested the PoC in Chrome) support CanvasRenderingContext2D.measureText()
Canvas context needs to have the correct font style applied
the PoC cheats here by assuming the input box's font is the same size as the options list
A. I don't think it's ok to expand the dropdown's width indefinitely. There will be many issues that will arise from this including going completely off screen.
B. That being said we could give it a default max-width of 400px allowing the dropdown to grow to 400px even if the input is narrower.
C. However, that would mean we need to change some styles of the dropdown quite a bit and would want to consider centering the dropdown to the input.
since this is coming in frequently from different sources, solving this would be great. at least it the max width should be configureable, would also help. many thanks
changed the title [-]Option to allow EuiComboBox dropdown to expand to not truncate options[/-][+][EuiComboBox] Allow dropdown to expand to not truncate options[/+]on Sep 20, 2020
@chandlerprall I think one issue with that solution could be that it requires "looking with your mouse", instead of your eyes. To get a sense for how that could be a frustrating UX, consider the screenshot in the description but with many fields that share the same stem, e.g. customer_first_name, customer_first_name_raw, customer_first_name_translated_fr, and so on. It'd be time-consuming to hunt through all of them with your mouse in order to find the one you want.
We're currently looking into a solution that would allow the option labels to wrap, but hinders on the ability from the plugin we use for virtualization. Otherwise a couple solutions we'll also look into are:
Middle truncation
Customizing width of popover
Most of the solutions will be opt-in, meaning there will still need to be follow up by Kibana. Another piece of this will be that the field selector in Kibana should just be full width of the containing popover instead of 50% and/or extend the width of that popover.
I got another request from a customer about this issue, they are struggling with selecting the right index pattern in discover. Their index pattern have long names that get truncated. I can't share the screenshot since it contains sensitive information
With elastic/kibana#85320 merged, this is no longer urgent, but I'm still leaving open in hopes we can find a solution during a refactor to using EuiSelectable.
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
@cchaos I like the options you suggested of either middle truncation or expanded popover width. Were you suggesting that the combo box should support both options, or that we should pick one as the preferred solution? Would this be something open to a contribution from Lens?
Small note that elastic/kibana#106285 implemented some logic within Lens for this. We might want to consider building this in directly through a truncate prop on the EUI components directly.
Activity
chandlerprall commentedon Jul 3, 2019
Took some time to look into this.
Complications
react-virtualizedrequires the width prop to be set, will not auto-expand to fit contentEuiComboBoxis designed to size up to but not exceeding 400px. This governed by CSS.Solution requirements
react-virtualizedclientWidth, for example)Proof of concept
I don't particularly like this approach, but wasn't able to come up with anything different. I also didn't try to reconcile the current
max-width: 400pxwith the new setup, instead forcing all dropdowns to auto-fit their contents.CanvasRenderingContext2D.measureText()Changes can be viewed at master...chandlerprall:feature/expanding-combobox-dropdown
cchaos commentedon Jul 12, 2019
My thoughts:
A. I don't think it's ok to expand the dropdown's width indefinitely. There will be many issues that will arise from this including going completely off screen.
B. That being said we could give it a default max-width of 400px allowing the dropdown to grow to 400px even if the input is narrower.
C. However, that would mean we need to change some styles of the dropdown quite a bit and would want to consider centering the dropdown to the input.
Something like, but not enamored by:
kertal commentedon Nov 28, 2019
since this is coming in frequently from different sources, solving this would be great. at least it the max width should be configureable, would also help. many thanks
[-]Option to allow EuiComboBox dropdown to expand to not truncate options[/-][+][EuiComboBox] Allow dropdown to expand to not truncate options[/+]lizozom commentedon Oct 29, 2020
Any updates on this by any chance?
chandlerprall commentedon Oct 30, 2020
@cchaos what about something like this?
cchaos commentedon Oct 30, 2020
Yeah I've mostly dropped the ball on this because it's actually a harder problem to solve than it seems on the surface.
@lizozom We'll make sure a solution is done in this minor (7.11)
cjcenizal commentedon Oct 30, 2020
@chandlerprall I think one issue with that solution could be that it requires "looking with your mouse", instead of your eyes. To get a sense for how that could be a frustrating UX, consider the screenshot in the description but with many fields that share the same stem, e.g.
customer_first_name,customer_first_name_raw,customer_first_name_translated_fr, and so on. It'd be time-consuming to hunt through all of them with your mouse in order to find the one you want.cchaos commentedon Nov 3, 2020
We're currently looking into a solution that would allow the option labels to wrap, but hinders on the ability from the plugin we use for virtualization. Otherwise a couple solutions we'll also look into are:
Most of the solutions will be opt-in, meaning there will still need to be follow up by Kibana. Another piece of this will be that the field selector in Kibana should just be full width of the containing popover instead of 50% and/or extend the width of that popover.
AlonaNadler commentedon Nov 17, 2020
I got another request from a customer about this issue, they are struggling with selecting the right index pattern in discover. Their index pattern have long names that get truncated. I can't share the screenshot since it contains sensitive information
cchaos commentedon Dec 10, 2020
With elastic/kibana#85320 merged, this is no longer urgent, but I'm still leaving open in hopes we can find a solution during a refactor to using EuiSelectable.
github-actions commentedon Jun 9, 2021
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment.
cjcenizal commentedon Jun 9, 2021
Still seems like an issue users will run into, so worth keeping this open?
wylieconlon commentedon Jun 29, 2021
@cchaos I like the options you suggested of either middle truncation or expanded popover width. Were you suggesting that the combo box should support both options, or that we should pick one as the preferred solution? Would this be something open to a contribution from Lens?
We recently ran into this in the Lens field list: elastic/kibana#103701
snide commentedon Aug 16, 2021
Small note that elastic/kibana#106285 implemented some logic within Lens for this. We might want to consider building this in directly through a
truncateprop on the EUI components directly.daveyholler commentedon Mar 27, 2023
Closing this as not-planned and in favor of #5997
JasonStoltz commentedon Oct 11, 2023
#7246 Introduces a
min-widthprop that will allow this dropdown to expand independently of the width of the dropdown element, which solves this issue.