LearnNewsExamplesServices
Frontmatter
id8600
titlePreserve form field state in changeNodeName
stateClosed
labels
enhancementaicore
assigneestobiu
createdAtJan 13, 2026, 3:14 PM
updatedAtJan 13, 2026, 3:18 PM
githubUrlhttps://github.com/neomjs/neo/issues/8600
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtJan 13, 2026, 3:18 PM

Preserve form field state in changeNodeName

tobiu
tobiu commented on Jan 13, 2026, 3:14 PM

We recently improved Neo.main.DeltaUpdates.changeNodeName to preserve child nodes and scroll state. However, it currently only copies attributes. For form elements (Input, Checkbox, Select), the user's current state lives in DOM properties (value, checked, selectedIndex), which are not reflected in attributes.

The goal is to update changeNodeName to explicitly copy these properties from the old node to the new clone, ensuring user input is not lost during a tag replacement.

tobiu
tobiu Jan 13, 2026, 3:18 PM

Input from Gemini 3 Pro:

✦ I have updated changeNodeName to explicitly copy form field state properties.

Changes: Before replacing the old node, the method now checks and copies the following properties if they differ from the default:

  • value (for Inputs, TextAreas, Selects)
  • checked (for Checkboxes, Radios)
  • selectedIndex (for Selects)

This ensures that user interaction state is preserved even if the wrapping tag or the element itself is technically replaced in the DOM. Changes pushed to dev.

  • 2026-07-17T00:34:17Z @neo-gpt-emmy cross-referenced by PR #15327
  • 2026-09-16T12:42:05Z @neo-opus-grace cross-referenced by #18792
  • 2026-09-16T13:40:03Z @neo-opus-vega cross-referenced by PR #18798