Uh oh!
There was an error while loading. Please reload this page.
feat(select): add alternate rendering strategy for improved accessibility - #14430
feat(select): add alternate rendering strategy for improved accessibility#14430crisbeto wants to merge 1 commit into
Conversation
@jelbourn a few things that are up in the air:
|
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
1 similar comment
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
11e6b33 to
141c534Comparejelbourn
commented
Jan 8, 2019
Per open questions:
|
jelbourn
left a comment
There was a problem hiding this comment.
High level- I don't quite follow why the new type of portal is necessary. What's the rundown of this approach vs. just visually the existing overlay?
Uh oh!
There was an error while loading. Please reload this page.
| } | ||
| /** DOM node hosting the portal's content. */ | ||
| get origin(): HTMLElement { |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| [style.transformOrigin]="_transformOrigin" | ||
| [style.font-size.px]="_triggerFontSize" | ||
| (keydown)="_handleKeydown($event)"> | ||
| <ng-content></ng-content> |
There was a problem hiding this comment.
Can we avoid doing the "ng-content inside ng-template` trick? It ends up always instantiating the content, even when it's not going to be attached.
There was a problem hiding this comment.
We could make it work by allowing people to provide an ng-template as the content. The problem is that we need the content to be rendered, in order to know what the options inside the select are. We need to know the options for a lot of things like showing the selected value, knowing where to position the dropdown, supporting keyboard navigation while closed etc.
crisbeto
commented
Jan 9, 2019
@jelbourn I'll go through the rest of the feedback. As for the reason why I introduced a new portal, it's because it makes it easier to switch between the two approaches and it's much more aligned with the rest of our setup. The alternative would be something like the approach in #11806 where we'd need to support multiple parallel code paths. |
141c534 to
cabdc2bComparecrisbeto
commented
Jan 9, 2019
@jelbourn all the feedback should be addressed now. |
Uh oh!
There was an error while loading. Please reload this page.
cabdc2b to
f3ffda0Comparecrisbeto
commented
Jan 12, 2019
@jelbourn the changes that we've discussed should be implemented now, can you take another look? |
f3ffda0 to
79bf5a9Compare77879e3 to
a2fa363CompareAdds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
…lity Currently `mat-select` has some accessibility issues, because we don't keep the options in the DOM until the select is attached, making it harder for assistive technology to pick it up. These changes add an alternate, opt-in, rendering strategy that'll keep the options inside the DOM. The rendering strategy is controlled through the `MAT_SELECT_RENDERING_STRATEGY` injection token. In order to facilitate the new rendering strategy, these changes introduce a new kind of portal called an `InlinePortal`. It is a portal whose content is transferred from one place in the DOM to another when it is attached/detached. Another change that was necessary for the new rendering to work was being able to pass a portal to the `CdkConnectedOverlay` directive. If no portal is passed, the directive will fall back to the current behavior.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Splaktar
commented
Jul 19, 2019
There is no mention here about presubmit failures or issues, but #11083 (comment) mentions
@jelbourn has this been presubmitted again after the May 2019 updates? If so, can you please confirm that this needs to be considered for closing due to too many presubmit failures? |
jelbourn
commented
Jul 19, 2019
Right- this change was unfortunately too breaking to land for existing Google apps. The new plan is bake the improvements into the MDC-based select component. |
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for angular#14430.
Adds a new type of portal called `DomPortal` which transfers the contents of a portal into the portal outlet and then restores them on destroy. This was implemented initially for #14430.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently
mat-selecthas some accessibility issues, because we don't keep the options in the DOM until the select is attached, making it harder for assistive technology to pick it up. These changes add an alternate, opt-in, rendering strategy that'll keep the options inside the DOM. The rendering strategy is controlled through theMAT_SELECT_RENDERING_STRATEGYinjection token.In order to facilitate the new rendering strategy, these changes introduce a new kind of portal called an
InlinePortal. It is a portal whose content is transferred from one place in the DOM to another when it is attached/detached.Another change that was necessary for the new rendering to work was being able to pass a portal to the
CdkConnectedOverlaydirective. If no portal is passed, the directive will fall back to the current behavior.