SD-2678 - Cannot delete contentlocked inline sdt with normal#3129
Open
chittolinag wants to merge 4 commits intomainfrom
Open
SD-2678 - Cannot delete contentlocked inline sdt with normal#3129chittolinag wants to merge 4 commits intomainfrom
chittolinag wants to merge 4 commits intomainfrom
Conversation
* fix: footer tcs in replacement generating one per character
…annot-delete-contentlocked-inline-sdt-with-normal # Conflicts: # pnpm-lock.yaml
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
caio-pizzol
reviewed
May 6, 2026
Contributor
caio-pizzol
left a comment
There was a problem hiding this comment.
hey @chittolinag! the original bug is fixed in the dev app :)
one thing to flag: Cmd+X breaks for unlocked fields. select the text inside, press Cmd+X, nothing gets cut and the whole field gets selected instead. fix is one line.
approve once that's in.
| // NodeSelection on the wrapper so the user sees the whole field | ||
| // highlighted and the next destructive press deletes it (matches | ||
| // Word's "click to select, key to delete"). | ||
| if (from !== to && !(selection instanceof NodeSelection)) { |
Contributor
There was a problem hiding this comment.
repro: open any unlocked inline field, triple-click to highlight the text inside, press Cmd+X. clipboard stays unchanged, the field's text is still there, and the highlight jumps to the whole field. paste anywhere to confirm "controlled text" is not on the clipboard. only Backspace and Delete should go through this branch:
Suggested change
| if (from !== to && !(selection instanceof NodeSelection)) { | |
| if ((isBackspace || isDelete) && from !== to && !(selection instanceof NodeSelection)) { |
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.
Issue
Structured content blocks (SDTs) configured with
contentLockedcould not be deleted as a whole. Users could neither remove them with backspace/delete at the wrapper boundary, nor select-and-delete the field — the lock plugin treated wrapper-level actions as in-content edits and blocked them.Proposed solution
Refined the structured-content lock plugin so it distinguishes wrapper-level actions from content edits:
NodeSelection, so the next destructive keypress removes the whole field (matching Word's "click to select, key to delete" behavior).contentLockedno longer blocks deletion of the field itself.Lock modes that protect the wrapper (
sdtLocked,sdtContentLocked) still prevent removal. Added unit tests covering the new paths.