feat(router): support custom elements for RouterLink#59567
Conversation
Closes #5 Upstream PR: angular/angular#59567
|
Thanks for giving this a shot. This is an interesting solution. After discussions with the team I think we'd want to evaluate other, more direct options. Some options we discussed, some of which could be worth further exploration, others certainly not:
Unfortunately, we don't have the capacity right now to take time determining the best path forward. |
|
Hello @atscott We are more than willing to put in the effort, if you give us a direction.
add a DI token to configure for element types always apply a/area behavior for custom elements only always apply a/area behavior for custom elements with 'href' properties add an input(s) or marker attribute(s) to the directive that explicitly enables the a/area and/or behavior Does this in any way relate to what was said by @mgechev here? https://www.youtube.com/watch?v=CMZHUPSmZx4&t=624s |
Noted because we aren't entirely throwing this option out as a possibility. |
Would you be able to do some testing here? IIUC, the observedAttributes are available even before upgrade is called. |
|
I will create a few test cases. 👍 |
Looking for the element in the registry and reading its observed attributes would be more effective, right? |
|
Yes, although that might need to be revisited when Scoped Custom Element Registries lands. Although from my understanding it would just be an additional call to get the declaration (e.g. |
|
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. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Relates to #28345
We as Web Component library authors have the problem that routerLink does not properly work with custom element anchor tags (native anchor tag wrapped in Shadow DOM). This is due to the lack of automatic href updates for elements besides
<a>/<area>and the internal logic of adding atabindex="0"attribute for non<a>/<area>elements.What is the new behavior?
This PR adds a multi provider
CUSTOM_ELEMENT_ANCHOR_TAG_NAMESfor adding RouterLink compatible custom elements.Does this PR introduce a breaking change?
Other information