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 4cc0c836bf..cf4f3adc73 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 @@ -1990,7 +1990,7 @@ export const template_visitors = { child_metadata.bound_contenteditable = true; } - if (needs_input_reset && (node.name === 'input' || node.name === 'select')) { + if (needs_input_reset && node.name === 'input') { context.state.init.push(b.stmt(b.call('$.remove_input_attr_defaults', context.state.node))); } diff --git a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js index d57f848f1e..1800479a68 100644 --- a/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js +++ b/packages/svelte/src/compiler/phases/3-transform/server/transform-server.js @@ -1851,18 +1851,27 @@ function serialize_element_attributes(node, context) { for (const attribute of node.attributes) { if (attribute.type === 'Attribute') { - if (attribute.name === 'value' && node.name === 'textarea') { - if ( - attribute.value !== true && - attribute.value[0].type === 'Text' && - regex_starts_with_newline.test(attribute.value[0].data) - ) { - // Two or more leading newlines are required to restore the leading newline immediately after `