fix: use getAttribute instead of .value

pull/11465/head
paoloricciuti 2 years ago
parent c862c984f5
commit 4baf1722a6

@ -16,10 +16,12 @@ import * as w from '../../warnings.js';
*/ */
export function remove_input_attr_defaults(dom) { export function remove_input_attr_defaults(dom) {
if (hydrating) { if (hydrating) {
const value = dom.value; // using getAttribute instead of dome.value allow us to have
// null instead of "on" if the user didn't set a value
const value = dom.getAttribute('value');
set_attribute(dom, 'value', null); set_attribute(dom, 'value', null);
set_attribute(dom, 'checked', null); set_attribute(dom, 'checked', null);
dom.value = value; if (value) dom.value = value;
} }
} }

Loading…
Cancel
Save