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

AutocompleteWidget: better display in small layouts #98

Open
vera opened this issue Jul 1, 2024 · 4 comments
Open

AutocompleteWidget: better display in small layouts #98

vera opened this issue Jul 1, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@vera
Copy link
Contributor

vera commented Jul 1, 2024

I just updated from version 1.9 to the most recent version.

I noticed that the display of the AutocompleteWidget is now less suitable for small layouts. E.g. we have an AutocompleteWidget inside a popover with width 400px. Previously 7 options could be shown at once:

Screenshot from 2024-07-01 16-07-05

Now only 4 options can be shown at once and I feel like some of the whitespace around the options is "wasted" space:

Screenshot from 2024-07-01 16-06-57

Maybe a compact option could be added when the widget is used in small spaces to get the old layout back?

@jusa3 jusa3 self-assigned this Jul 2, 2024
@jusa3 jusa3 added the enhancement New feature or request label Jul 2, 2024
@jusa3 jusa3 mentioned this issue Jul 2, 2024
@rombaum
Copy link
Collaborator

rombaum commented Jul 2, 2024

@vera nice idea to provide a compact view.

However, Just to let you know. I'm missing some information in your second screenshot. MeSH and also some entities of SNOMED CT will provide a description which could be added to the autocomplete:

grafik

or only with SNOMED CT

grafik

Just add &fieldList=description,label,iri,ontology_name,type,short_form to your integration than you will get also the description for the suggested terms.

@vera
Copy link
Contributor Author

vera commented Jul 4, 2024

@rombaum thank you for the tip!

When I add the descriptions, I have the opposite problem than above when the widget has a lot of space and is quite wide:

image

The descriptions are cut off short even though there would be more space available.

@jusa3
Copy link
Collaborator

jusa3 commented Jul 4, 2024

The descriptions are truncated after 40 characters. I could provide an option to adapt that, too. Maybe we should think about a parameter analogous parameter such as styleParams, which can hold multiple style related parameters and can be easily extended @rombaum ?

@jusa3
Copy link
Collaborator

jusa3 commented Jul 5, 2024

Not straightforward with CSS inline styles and text-overflow: ellipsis.

Found another possible solution: the EuiComboBox component prop truncationProps. Only available since v88.4.0 so we first would need to update Eui.

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

No branches or pull requests

3 participants