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
blockedBy[]
blocking[]
closedAtJan 13, 2026, 3:18 PM

Preserve form field state in changeNodeName

Closed v11.21.0 enhancementaicore
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 added the enhancement label on Jan 13, 2026, 3:14 PM
tobiu added the ai label on Jan 13, 2026, 3:14 PM
tobiu added the core label on Jan 13, 2026, 3:14 PM
tobiu assigned to @tobiu on Jan 13, 2026, 3:17 PM
tobiu referenced in commit 1f8f26b - "enhancement: Preserve form field state in changeNodeName (#8600) on Jan 13, 2026, 3:18 PM
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.

tobiu closed this issue on Jan 13, 2026, 3:18 PM