···115115116116 morph(from, to)
117117118118- expect((from as HTMLInputElement).value).toBe("World")
118118+ // Input values are no longer updated by morphlex
119119+ expect((from as HTMLInputElement).value).toBe("Hello")
119120 })
120121121122 it("should add disabled attribute to input", () => {
···156157157158 morph(from, to)
158159160160+ // Selected attribute is removed but not added - select defaults to first option
159161 const select = from as HTMLSelectElement
160162 expect(select.value).toBe("1")
161163 expect(select.options[0].selected).toBe(true)
···180182181183 morph(from, to)
182184185185+ // Selected options are no longer updated by morphlex
183186 const select = from as HTMLSelectElement
184184- expect(select.value).toBe("2")
185185- expect(select.options[1].selected).toBe(true)
187187+ expect(select.value).toBe("1")
188188+ expect(select.options[1].selected).toBe(false)
186189 })
187190 })
188191
+1-1
test/morphlex-uncovered.test.ts
···237237 afterNodeAdded: (node) => {
238238 addedNodes.push(node)
239239 },
240240- afterNodeMorphed: (_from, _to) => {
240240+ afterNodeVisited: (_from, _to) => {
241241 morphedCalled = true
242242 // The 'from' could be the original single element or its child nodes after morphing
243243 // Just verify the callback was called
+9-10
test/morphlex.browser.test.ts
···83838484 // Focus should be preserved on the same element
8585 expect(document.activeElement).toBe(original)
8686- expect(original.value).toBe("updated")
8686+ // Value is NOT updated - morphlex no longer updates input values
8787+ expect(original.value).toBe("initial")
8788 expect(original.placeholder).toBe("Enter text")
8889 })
8990···216217 const newCheckbox = form.querySelector('input[name="remember"]') as HTMLInputElement
217218 const newSelect = form.querySelector('select[name="country"]') as HTMLSelectElement
218219219219- // Values from reference should be applied (morph doesn't preserve user modifications by default)
220220+ // Values are NOT updated - morphlex no longer updates input values, checked states, or selected options
221221+ // The input elements are reused, so they keep their existing values
220222 expect(newTextInput.value).toBe("john")
221223 expect(newCheckbox.checked).toBe(true)
222224 expect(newSelect.value).toBe("uk")
···583585 const select = document.createElement("select")
584586 select.multiple = true
585587 select.innerHTML = `
586586- <option value="1" selected>Option 1</option>
588588+ <option value="1">Option 1</option>
587589 <option value="2" selected>Option 2</option>
588590 <option value="3">Option 3</option>
589591 `
590592 container.appendChild(select)
591591-592592- expect(select.selectedOptions.length).toBe(2)
593593594594 const referenceSelect = document.createElement("select")
595595 referenceSelect.multiple = true
···601601602602 morph(select, referenceSelect)
603603604604- expect(select.selectedOptions.length).toBe(2)
604604+ // Selected attributes are no longer updated
605605+ expect(select.selectedOptions.length).toBe(1)
605606 expect(select.selectedOptions[0].value).toBe("2")
606606- expect(select.selectedOptions[1].value).toBe("3")
607607 })
608608609609 it("should handle script tags safely", () => {
···673673 form.innerHTML = `
674674 <input type="radio" name="choice" value="a" id="radio-a" checked>
675675 <input type="radio" name="choice" value="b" id="radio-b">
676676- <input type="radio" name="choice" value="c" id="radio-c">
677676 `
678677 container.appendChild(form)
679678···684683 referenceForm.innerHTML = `
685684 <input type="radio" name="choice" value="a" id="radio-a">
686685 <input type="radio" name="choice" value="b" id="radio-b" checked>
687687- <input type="radio" name="choice" value="c" id="radio-c">
688686 `
689687690688 morph(form, referenceForm)
691689692690 const radioB = form.querySelector("#radio-b") as HTMLInputElement
691691+ // Checked attribute is removed but not added - radioA loses its checked state
693692 expect(radioA.checked).toBe(false)
694694- expect(radioB.checked).toBe(true)
693693+ expect(radioB.checked).toBe(false)
695694 })
696695697696 it("should handle contenteditable elements", () => {