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

move tag-container outside select-button #2346

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mayank99
Copy link
Contributor

@mayank99 mayank99 commented Nov 18, 2024

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 (because ComboBox has slightly different markup from Select). 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.

@mayank99 mayank99 self-assigned this Nov 18, 2024
@mayank99 mayank99 marked this pull request as ready for review November 18, 2024 22:34
@mayank99 mayank99 requested a review from a team as a code owner November 18, 2024 22:34
@mayank99 mayank99 requested review from r100-stack and smmr-dn and removed request for a team November 18, 2024 22:34
Comment on lines +18 to +20
- <span class='iui-content'>
- <div class='iui-select-tag-container'>…</div>
- </span>
Copy link
Member

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.

Suggested change
- <span class='iui-content'>
- <div class='iui-select-tag-container'>…</div>
- </span>
- <span class='iui-content'>
- <div class='iui-select-tag-container'>…</div>
- </span>

Copy link
Member

@r100-stack r100-stack Nov 18, 2024

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'] & {

Copy link
Member

@r100-stack r100-stack left a 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 🚀

@mayank99
Copy link
Contributor Author

Let's leave this one out of 3.16.0. It can go in the next minor after that.

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

Successfully merging this pull request may close these issues.

3 participants