-
Notifications
You must be signed in to change notification settings - Fork 8
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
Support for ellipsis text in dropdown list components #1658
Labels
enhancement
New feature or request
Comments
vivinkrishna-ni
added
enhancement
New feature or request
triage
New issue that needs to be reviewed
labels
Nov 10, 2023
1 task
1 task
mollykreis
added a commit
that referenced
this issue
Nov 27, 2023
# Pull Request ## 🤨 Rationale Resolves #1658 I also noticed that we had a workaround in the nimble-list-option for a FAST issue that has been fixed upstream, so I removed the workaround and validated that the issue is in fact fixed. ## 👩💻 Implementation - Added styling to the nimble-list-option to ellipsis the content if it gets too long - Leverage existing `overflow` directive to the list option template so that a `title` will be applied when the text is too long - This required forking the FAST template for the list option, so in addition to forking the template, I also brought in the FAST tests. ## 🧪 Testing - Manually tested overflow behavior in storybook - Manually tested that issue that had a workaround is still behaving as expected with the workaround removed. - Wrote new unit tests to verify the overflow/title behavior - Brought in the FAST unit tests for the list option since the template has now been forked ## ✅ Checklist <!--- Review the list and put an x in the boxes that apply or ~~strike through~~ around items that don't (along with an explanation). --> - [ ] I have updated the project documentation to reflect my changes or determined no changes are needed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
😯 Problem to Solve
Components like nimble-listbox, nimble-select, and nimble-combobox display a list of options for selection. These options can include long text, and if the client wishes to limit the width of the overall component, the text may become clipped or hidden within the option. To address this, ellipsis (...) can be used to indicate truncated text for long strings within the option.
Relevant conversation: #1654 (comment)
💁 Proposed Solution
Add
text-overflow: ellipsis
to thenimble-list-option
content slot element (code link) like below:If client sets
max-width
or otherwise limits the width, text wrapsIf sufficient space is available, some components can grow but it eventually looks silly
The text was updated successfully, but these errors were encountered: