-
Notifications
You must be signed in to change notification settings - Fork 38
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
move tag-container outside select-button #2346
base: main
Are you sure you want to change the base?
Conversation
880d4f8
to
377e247
Compare
- <span class='iui-content'> | ||
- <div class='iui-select-tag-container'>…</div> | ||
- </span> |
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.
nit: the indentation can be changed to make it easier to read.
- <span class='iui-content'> | |
- <div class='iui-select-tag-container'>…</div> | |
- </span> | |
- <span class='iui-content'> | |
- <div class='iui-select-tag-container'>…</div> | |
- </span> |
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.
For the small size, I noticed that the ::before
for the higher click target is not present. Also, the text seems larger. Are these some issues on my end?
EDIT: I think the selectors near this one need to be updated:
.iui-select-button[data-iui-size='small'] & { |
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.
LGTM once the open comments are resolved 🚀
Let's leave this one out of 3.16.0. It can go in the next minor after that. |
Changes
This is another step towards #907.
The main change is that the tag-container is rendered outside the select-button, then positioned on top of the select-button (using
grid-area
). This opens up the possibility of rendering a "clear" (❌) button inside the individual tags, without leading to nested interactive elements (invalid).To facilitate this change, I had to add some CSS for making it overlap the select-button and have the correct padding. It relies on the
~
combinator which I'm not super happy about, and there is some duplicated CSS as well (becauseComboBox
has slightly different markup fromSelect
). These are things we could improve in the future.Since there is nothing else in the select-button, it poses a challenge for the accessible name/label. I solved it by moving the already existing visually-hidden live region inside the select-button. This ensures that the select-button is properly labeled and compatible with the existing handling of concatenated labels in
InputGrid
/LabeledSelect
.Testing
Updated affected unit tests and visual tests.
One noticeable visual change is that the small select is now 24px tall (correct) instead of 26px (incorrect).
Docs
Added changesets.