fix: ensure value is correctly set to zero on the progress element (#13924)

* fix: ensure value is correctly set to zero on the progress element

* fix: ensure value is correctly set to zero on the progress element

* fix: ensure value is correctly set to zero on the progress element
pull/13920/head
Dominic Gannaway 2 months ago committed by GitHub
parent 1e6cf1bb40
commit 37fa34c4ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: ensure value is correctly set to zero on the progress element

@ -54,8 +54,13 @@ export function remove_input_defaults(input) {
export function set_value(element, value) {
// @ts-expect-error
var attributes = (element.__attributes ??= {});
// @ts-expect-error
if (attributes.value === (attributes.value = value) || element.value === value) return;
if (
attributes.value === (attributes.value = value) ||
// @ts-expect-error
// `progress` elements always need their value set when its `0`
(element.value === value && (value !== 0 || element.nodeName !== 'PROGRESS'))
)
return;
// @ts-expect-error
element.value = value;
}

Loading…
Cancel
Save