You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of now a <PortalTarget> is rendered as <div>. In some situations you want to be more specific in expressing proper semantics and a <div> isn't the best solution, or you have to wrap the <div> from <PortalTarget> in a more semantic element, but that clutters the actual output.
I'm using a technic to make this customizable quite well and am proposing for this situation, too in using the (element) helper:
Invocation:
<PortalTarget @element={{element'nav'}} ... />
And inside of it:
{{#let (or @element (element'div')) as |Element|}}
<Element ...>...</Element>
{{/let}}
This way it will keep <div> as a default/fallback but provides a strategy to override this.
WDYT?
The text was updated successfully, but these errors were encountered:
An alternative would be to expose a modifier, so you can attach the target to any existing element. However while the addon currently does not support FastBoot correctly, it would be possible to do that probably with the existing component API, while a modifier won't ever run in FastBoot, so that's not so good...
@gossi just ran into a case where I'd prefer to have fewer DOM elements as you outlined, did you ever end up tackling this? Not at all urgent but thought I'd ask 😄
As of now a
<PortalTarget>
is rendered as<div>
. In some situations you want to be more specific in expressing proper semantics and a<div>
isn't the best solution, or you have to wrap the<div>
from<PortalTarget>
in a more semantic element, but that clutters the actual output.I'm using a technic to make this customizable quite well and am proposing for this situation, too in using the
(element)
helper:Invocation:
And inside of it:
This way it will keep
<div>
as a default/fallback but provides a strategy to override this.WDYT?
The text was updated successfully, but these errors were encountered: