refactor(aria/tabs): clean up tab selection and linking to panels#32859
refactor(aria/tabs): clean up tab selection and linking to panels#32859adolgachev wants to merge 1 commit intoangular:mainfrom
Conversation
|
Deployed dev-app for d0613b3 to: https://ng-dev-previews-comp--pr-angular-components-32859-dev-pxtvzh2b.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
|
Deployed docs-preview for d0613b3 to: https://ng-dev-previews-comp--pr-angular-components-32859-docs-58cy5tjn.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
9f18364 to
cb3c051
Compare
f6c32a1 to
d913ebb
Compare
be451be to
45041c5
Compare
fd5f0bb to
96f2cbb
Compare
54ee045 to
fa930ac
Compare
c687368 to
b914539
Compare
|
We should put this change on hold for two main reasons
|
374f2c5 to
2de91db
Compare
| [...this._unorderedPanels()].map(tabpanel => tabpanel._pattern), | ||
| ); | ||
| constructor() { | ||
| effect(() => { |
There was a problem hiding this comment.
use afterRenderEffect as discussed. Same comment for other places.
There was a problem hiding this comment.
Yup, in the other place it actually shows up as a bug with the Scrollable example. Added comments too.
| readonly selectedTab = model<string | undefined>(); | ||
|
|
||
| /** The current selected Tab pattern, passed to the List pattern. */ | ||
| private readonly _selectedTabPattern: WritableSignal<TabPattern | undefined> = signal(undefined); |
There was a problem hiding this comment.
This can probably be a linkedSignal instead of computed in effect?
There was a problem hiding this comment.
That actually did not work... let me try to put it back to test again and add a comment why though.
There was a problem hiding this comment.
Cool, it is actually working now. It may have just been an issue with the full PR. But tested local tests and with browserstack to make sure and looks good.
94cfe7e to
91dce82
Compare
Refactors Tabs pattern to simplify how tabs are associated with their tab panels, as well as other dependent code.
This is a revision of the previous approach which swapped to use contentChildren and template references only
This just includes clean up and re-factoring to move the value matching of Tab and TabPanel to the directive and remove extra synching of selection and linked state in favor of a more direct approach.