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
Now is no good way use it like <SvgIcon aria-label="lorem"></SvgIcon>
Every frontend developer knows the aria-label attribute and what it does, but it cannot be used. All possible options like ariaLabel, aria_label and so on are not standard and less understandable.
It can be done with export let label = $$props['aria-label'];, but, if I understood the documentation correctly, it's better not to do this due to performance issues.
Describe the proposed solution
I see #3852, but the discussion was about warnings and custom attributes in kebab-case, maybe implementing the ability to use native attributes would be easier? Using a whitelist?
There can be many options with different syntax. For example:
Describe the problem
Now there is no good way to use native HTML attributes in kebab-case as they are defined in the specification.
In Svelte need to specify all prop, can't just use native attributes.
For example component
SvgIcon
:And use it:
Now is no good way use it like
<SvgIcon aria-label="lorem"></SvgIcon>
Every frontend developer knows the
aria-label
attribute and what it does, but it cannot be used. All possible options likeariaLabel
,aria_label
and so on are not standard and less understandable.It can be done with
export let label = $$props['aria-label'];
, but, if I understood the documentation correctly, it's better not to do this due to performance issues.Describe the proposed solution
I see #3852, but the discussion was about warnings and custom attributes in kebab-case, maybe implementing the ability to use native attributes would be easier? Using a whitelist?
There can be many options with different syntax. For example:
Function overriding the attribute name:
Defining the attribute name during assignment:
Special object accepting attributes from a whitelist:
Either way, the ability to use attributes in HTML as defined in the specification will make the code more understandable.
Importance
would make my life easier
The text was updated successfully, but these errors were encountered: