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

[WEB-372] fix: horizontal rule extension now always divider adds below nodes #3890

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

Palanikannan1437
Copy link
Collaborator

Description

When a horizontal rule/divider is placed in the position under an empty leaf node (such as an image/table/etc), it was not being inserted after the node.

Detailed Description of Changes:

Preventing Horizontal Rule from Appearing Before a Node:

The key change is in the way the position for inserting a horizontal rule is calculated when there's only a cursor at the position, particularly when the cursor is at the beginning (parentOffset === 0) of a node. Previously, the position calculated for insertion subtracted 2 from $originTo.pos, which could lead to the rule appearing before the intended node. This has been corrected to subtract 1 instead, ensuring the rule is inserted at the correct location, directly where the cursor is, avoiding unintended placements before the node.

This adjustment ensures that the rule is inserted in a more expected location, especially in cases where the cursor is at the very start of a node.

Demo

Screen.Recording.2024-03-06.at.6.24.44.PM.mov

@sriramveeraghanta sriramveeraghanta merged commit cace132 into develop Mar 6, 2024
11 of 14 checks passed
@sriramveeraghanta sriramveeraghanta deleted the fix/horizontal-rule branch March 6, 2024 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants