diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts index 9b7bbfef74..6c2c439279 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts @@ -342,9 +342,9 @@ export default class ElementWrapper extends Wrapper { block.maintain_context = true; } + this.add_attributes(block); this.add_bindings(block); this.add_event_handlers(block); - this.add_attributes(block); this.add_transitions(block); this.add_animation(block); this.add_actions(block); diff --git a/test/runtime/samples/binding-input-range-change-with-max/_config.js b/test/runtime/samples/binding-input-range-change-with-max/_config.js new file mode 100644 index 0000000000..1fda90d83c --- /dev/null +++ b/test/runtime/samples/binding-input-range-change-with-max/_config.js @@ -0,0 +1,33 @@ +export default { + html: ` + + +
10 of 10
+ `, + + ssrHtml: ` + + +10 of 10
+ `, + + async test({ assert, target, window }) { + const input = target.querySelector('input'); + assert.equal(input.value, '10'); + + // should not change because max is 10, input range behaviour + // seems there is bug in jsdom (HTMLInputElement-impl) which behaviour is different from real browsers + // input.value = '20'; + // assert.equal(input.value, '10'); + + const button = target.querySelector('button'); + await button.dispatchEvent(new window.Event('click')); + + assert.equal(input.value, '20'); + assert.htmlEqual(target.innerHTML, ` + + +20 of 20
+ `); + }, +}; diff --git a/test/runtime/samples/binding-input-range-change-with-max/main.svelte b/test/runtime/samples/binding-input-range-change-with-max/main.svelte new file mode 100644 index 0000000000..b6c856976e --- /dev/null +++ b/test/runtime/samples/binding-input-range-change-with-max/main.svelte @@ -0,0 +1,13 @@ + + +