Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SuperEditor] Make getDocumentPositionAfterExpandedDeletion return null for collapsed selections (Resolves #2431) #2436

Conversation

angelosilvestre
Copy link
Collaborator

[SuperEditor] Make getDocumentPositionAfterExpandedDeletion return null for collapsed selections. Resolves #2431

The CommonEditorOperations.getDocumentPositionAfterExpandedDeletion returns a TextNodePosition even when the selection is collapsed. In this situation, we expect nothing to be deleted and no selection change.

Currently, if all nodes in the selection are non-deletable, this method returns null. To keep consistency, this PR changes this method to also return null when the selection is collapsed.f

Copy link
Contributor

@matthew-carroll matthew-carroll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@matthew-carroll matthew-carroll merged commit 90f4fe0 into main Dec 11, 2024
13 of 14 checks passed
@matthew-carroll matthew-carroll deleted the 2431_getDocumentPositionAfterExpandedDeletion-return-null branch December 11, 2024 00:28
github-actions bot pushed a commit that referenced this pull request Dec 11, 2024
matthew-carroll pushed a commit that referenced this pull request Dec 11, 2024
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.

[BUG] - getDocumentPositionAfterExpandedDeletion with collapsed selection on block node returns TextPosition
2 participants