From 9db48109dfe57a505d5a52b48244a0b09f72464b Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 23 Feb 2024 16:46:39 -0500 Subject: [PATCH] tweak --- .../compiler/phases/3-transform/client/visitors/template.js | 2 +- packages/svelte/src/internal/client/render.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js index 46906b3e98..1117f3cdb7 100644 --- a/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js +++ b/packages/svelte/src/compiler/phases/3-transform/client/visitors/template.js @@ -492,7 +492,7 @@ function serialize_element_attribute_update_assignment(element, node_id, attribu let grouped_value = value; if (name === 'autofocus') { - state.init.push(b.stmt(b.call('$.auto_focus', node_id, value))); + state.init.push(b.stmt(b.call('$.autofocus', node_id, value))); return false; } diff --git a/packages/svelte/src/internal/client/render.js b/packages/svelte/src/internal/client/render.js index 273d1d5628..824e111e24 100644 --- a/packages/svelte/src/internal/client/render.js +++ b/packages/svelte/src/internal/client/render.js @@ -492,7 +492,7 @@ export function text(dom, value) { * @param {boolean} value * @returns {void} */ -export function auto_focus(element, value) { +export function autofocus(element, value) { if (value) { element.autofocus = true; @@ -2008,7 +2008,7 @@ export function spread_attributes(dom, prev, attrs, lowercase_attributes, css_ha } else if (key === 'style') { dom.style.cssText = value + ''; } else if (key === 'autofocus') { - auto_focus(/** @type {HTMLElement} */ (dom), Boolean(value)); + autofocus(/** @type {HTMLElement} */ (dom), Boolean(value)); } else if (key === '__value' || key === 'value') { // @ts-ignore dom.value = dom[key] = dom.__value = value;