fix: update column resize logic to account for RTL tables#335
Open
priceld wants to merge 1 commit intoProseMirror:masterfrom
Open
fix: update column resize logic to account for RTL tables#335priceld wants to merge 1 commit intoProseMirror:masterfrom
priceld wants to merge 1 commit intoProseMirror:masterfrom
Conversation
priceld
commented
Mar 16, 2026
Comment on lines
+157
to
+165
| if (event.clientX - left <= handleWidth) { | ||
| const tableDOM = domTableAround(target); | ||
| const isRTL = isTableRTL(tableDOM); | ||
| cell = edgeCell(view, event, isRTL ? 'end' : 'start', handleWidth); | ||
| } else if (right - event.clientX <= handleWidth) { | ||
| const tableDOM = domTableAround(target); | ||
| const isRTL = isTableRTL(tableDOM); | ||
| cell = edgeCell(view, event, isRTL ? 'start' : 'end', -handleWidth); | ||
| } |
Author
There was a problem hiding this comment.
note: I duplicated the isTableRTL in each branch of the if to hopefully save a little on performance.
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 #333
This change updates the column resize logic for tables that are in the RTL direction. The direction of the table needs to be examined:
Ideally, the direction of the table would only be checked once, but I couldn't see a clean way to do that without a breaking change to
ResizeState.I did not update any tests since the resize plugin isn't currently tested.
Demo
Screen.Recording.2026-03-16.at.3.35.01.PM.mp4
Note
Disclaimer: I did use an LLM to get me started on this change, but I have reviewed and tested everything myself.