-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(cdk-experimental/ui-patterns): create List behavior #31601
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
Conversation
ea85bf3
to
23f0334
Compare
.on('Home', () => this.first()) | ||
.on('End', () => this.last()) | ||
.on(this.typeaheadRegexp, e => this.search(e.key)); | ||
.on(this.prevKey, () => this.listBehavior.prev()) |
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 with the List behavior can also provide basic event manager since the arrow keys and home/end behaviors are the same across UI patterns.
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.
We could but I think decentralizing event handlers will make tracking event handler logic harder in the future
23f0334
to
5543fb0
Compare
- Adds a new `List` behavior class to `@angular/cdk-experimental/ui-patterns/behaviors`. - This new behavior composes the existing `ListFocus`, `ListNavigation`, `ListSelection`, and `ListTypeahead` behaviors into a single, cohesive class for managing the state and interactions of a list-based component. - This behavior is intended to be unify the copy/pasted logic in `ListboxPattern`, `TreePattern`, `RadioGroupPattern`, and any other patterns where it makes sense. The `List` behavior provides a simplified, high-level API for common list operations, including: - Navigation (`next`, `prev`, `first`, `last`) - Selection (single, multi, range) - Typeahead search - Focus management (`roving` and `activedescendant`)
5543fb0
to
cfc9521
Compare
List
behavior class to@angular/cdk-experimental/ui-patterns/behaviors
.ListFocus
,ListNavigation
,ListSelection
, andListTypeahead
behaviors into a single, cohesive class for managing the state and interactions of a list-based component.ListboxPattern
,TreePattern
,RadioGroupPattern
, and any other patterns where it makes sense.The
List
behavior provides a simplified, high-level API for common list operations, including:next
,prev
,first
,last
)roving
andactivedescendant
)