Skip to content

Make $.extend() calls non-recursive in _updateRow(). - #1102

Open
DanielRLevine wants to merge 1 commit into
tabalinas:masterfrom
DanielRLevine:master
Open

Make $.extend() calls non-recursive in _updateRow().#1102
DanielRLevine wants to merge 1 commit into
tabalinas:masterfrom
DanielRLevine:master

Conversation

@DanielRLevine

Copy link
Copy Markdown

This will fix #1100.

rok9ru added a commit to rok9ru/jsxgrid that referenced this pull request Aug 28, 2026
Deep merge ($.extend(true, ...)) recursively merged nested objects instead
of replacing them - wrong whenever a field's edited value is itself an
object (e.g. a date-range {from, to} value), since old and new nested keys
would get merged together instead of the new value replacing the old one.

Cherry-picked from upstream PR tabalinas#1102.
rok9ru added a commit to rok9ru/jsxgrid that referenced this pull request Aug 28, 2026
…urce

onItemUpdating's args.item was passed as updatedItem, so if a consumer's
handler mutates args.item, that mutation is on updatedItem already; merging
from the original editedItem instead silently discarded it. Reconciled by
hand with the shallow-extend fix from tabalinas#1102, which touches this same line.

Cherry-picked from upstream PR tabalinas#1234.
rok9ru added a commit to rok9ru/jsxgrid that referenced this pull request Aug 28, 2026
… field editing

Running the QUnit suite after cherry-picking tabalinas#1102 failed
'complex properties binding: updating deeply nested prop' - shallow $.extend
drops sibling nested keys when two dot-path fields (e.g.
'complexProp.subprop1.prop1' and 'complexProp.subprop1.subprop2.prop12')
share a nested ancestor, since it only merges top-level keys. That's a real,
tested, documented feature (_setItemFieldValue builds genuinely nested
objects for dot-path field names), so restoring deep $.extend(true, ...)
for both merges in _updateRow. tabalinas#1234's actual fix (merge from the
onItemUpdating-mutated updatedItem rather than the raw editedItem) is
unaffected and stays.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recursive jQuery extend causes undesired result

1 participant