Repository navigation
fix: preserve condition picker draft when sorting - #21519
Open
Shubham-Padkonde wants to merge 1 commit into
Open
Shubham-Padkonde wants to merge 1 commit into
Shubham-Padkonde wants to merge 1 commit into
Conversation
Signed-off-by: Shubham Padkonde <shubhampadkonde12@gmail.com>
|
👍 Thanks for this! Please review the labels and make any necessary changes. |
tomasky
added a commit
to tomasky/amis
that referenced
this pull request
Sep 27, 2026
- QuickEdit: handleWindowKeyPress 误用包裹元素 tagName 判断,导致快速编辑输入框内空格被拦截 - ListStore.reset: 拖拽后未还原数组顺序,moved 归零但展示顺序仍为拖拽后顺序 - condition-builder: 拖拽读取 props 而非当前草稿 value/onChange,非内嵌 Picker 下排序丢失 同步自社区 PR baidu#21525 / baidu#21517 / baidu#21519
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #12216.
With
embed: false, the condition builder edits a draft managed byPickerContainer, but drag-and-drop readsthis.props.valueand calls the finalthis.props.onChange. Sorting newly added conditions before the first confirmation therefore throwsCannot read properties of undefined (reading 'id'); sorting existing conditions bypasses confirmation and publishes changes even if the dialog is canceled.Capture the rendered, normalized value and its change callback when dragging starts. Apply the reordered tree through that callback and release the drag context when dragging ends. Embedded mode continues updating immediately.
Three DOM-event regression tests cover sorting a new draft and confirming, canceling/reopening a sorted existing draft, and immediate embedded updates. Before the fix the two popup tests fail and the embedded control passes. Afterward all 16 condition-builder tests pass.
Validation:
npm run build: passed (Node 26.7.0).npm run typecheck: passed after the build (Node 20.20.2, matching the CI major version).npm test --workspaces -- --runInBand: 1,264 tests passed across the formula, core, UI, and AMIS workspaces (Node 20.20.2). The editor workspaces report no test script implementation.git diff --checkpassed.The separate office-viewer test suite was not run. This contribution was developed with OpenAI Codex assistance; the reproductions and checks above were executed locally.