-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Closed
Description
Describe the bug
All other attributes are included unless their value is nullish (
null
orundefined
).
https://svelte.dev/docs/svelte/basic-markup#Element-attributes
Because events are just attributes, the same rules as for attributes apply:
https://svelte.dev/docs/svelte/basic-markup#Events
However, ondblclick={null}
is treated differently in the JS output:
<button name={undefined} value={null} onclick={undefined} ondblclick={null}></button>
$.set_attribute(button, 'name', undefined);
$.set_value(button, null);
button.__click = undefined;
button.__dblclick = function (...$$args) {
(null)?.apply(this, $$args);
};
Shouldn't this be button.__dblclick = null;
instead?
Reproduction
https://svelte.dev/playground/d6dd8c1f6355475fbe357d501b60137a?version=5.38.6
Logs
System Info
-
Severity
annoyance
Prinzhorn
Metadata
Metadata
Assignees
Labels
No labels