-
Notifications
You must be signed in to change notification settings - Fork 74
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
feat(combobox): add ability to group options #639
base: main
Are you sure you want to change the base?
Conversation
Thank you, 🤖 Clarity Release Bot |
4c68b43
to
66f4698
Compare
This comment was marked as outdated.
This comment was marked as outdated.
bc2f7f1
to
d37b026
Compare
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.
I like it!
A11y, UX, PM and I sign it "approved".
'[style.display]': 'clrOptionItems.hasResults ? undefined : "none"', | ||
}, | ||
template: ` | ||
<span class="clr-option-group-label" role="presentation">{{ label }}</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.
Not really sure about this, but it will probably be covered by Amy's suggestion for ariaLabeledBy
?
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.
Yeah.
@@ -98,7 +98,7 @@ export class ClrOptions<T> implements AfterViewInit, LoadingListener, OnDestroy | |||
@Input('id') optionsId: string; | |||
|
|||
_items: QueryList<ClrOption<T>>; | |||
@ContentChildren(ClrOption) | |||
@ContentChildren(ClrOption, { descendants: true }) |
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.
I really hope no-one tries to nest comboboxes :D
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.
It can actually solve some problems, when people try to wrap options in their own component.
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.
I will look into that.
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.
Actually, nesting comboxes makes zero sense. So...
d37b026
to
ace8f2c
Compare
ead224c
to
ace8f2c
Compare
Any update on this pull request merge? |
Could this be prioritized for next minor version release? |
Disclaimer
PR Checklist
PR Type
Feature
What is the current behavior?
The combobox does not a built-in way to group options. Attempts to do this on the "consumer" side are hacky and and not fully accessible.
Issue Number: #635
What is the new behavior?
The combobox allows grouping options.
I used this example as guide: https://www.w3.org/WAI/ARIA/apg/patterns/listbox/examples/listbox-grouped/
Does this PR introduce a breaking change?
No.