In svelte (3.42.5) attributes named "value" are translated differently from other attributes.
I.e. the component
<progress value="50" max="100"/>
translates to
...
function create_fragment(ctx) {
...
return {
c() {
progress = element("progress");
progress.value = "50";
attr(progress, "max", "100");
},
...
As one can see the attribute "value" is set in another way than "max". Although this is perfectly correct javascript code in browser it makes svelte-native struggle.
Furthermore I ask myself why svelte has this special handling?!? And is there a way to turn it off?
As far as I know,
value
is a reserved keyword to set the value of this tag/component.For example: when you are using select & option tags, the value of the option is set with the value key word.
So I would say no, you can not deactivate this behavior.
Reference: https://svelte.dev/docs#Binding_select_value