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

feat(richtext-lexical): add new paragraph button below the editor #10530

Merged
merged 8 commits into from
Jan 13, 2025

Conversation

AlessioGr
Copy link
Member

@AlessioGr AlessioGr commented Jan 13, 2025

Fixes #10448. If the last node in an editor was a block, the only way to add a paragraph below that block was to click the "+" button on the left hand-side of the editor.

This was not apparent enough for most users - thus this PR adds a more prominent, accessible "+" button that appear when hovering close to the end of the editor. This should make it easier to insert additional paragraphs, no matter what the last node is.

See it in action

CleanShot.2025-01-12.at.18.37.48.mp4

@rilrom
Copy link
Contributor

rilrom commented Jan 13, 2025

This looks great. An edge case I can think of is whether there would be any overlap between the table add row button and this button.

@AlessioGr
Copy link
Member Author

This looks great. An edge case I can think of is whether there would be any overlap between the table add row button and this button.

There's a tiny overlap - not sure if this edge case is worth extra complexity to fix it:

CleanShot.2025-01-12.at.19.09.21.mp4

We might also want to consolidate the styling of the table + button

@rilrom
Copy link
Contributor

rilrom commented Jan 13, 2025

Looks good to me, still very much useable. Thanks for checking!

@AlessioGr
Copy link
Member Author

CleanShot.2025-01-12.at.19.27.18.mp4

Made the styles for table buttons & add paragraph buttons more consistent

Copy link
Member

@tylandavis tylandavis left a comment

Choose a reason for hiding this comment

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

We should place the cursor on the new line, same as the + button on the left margin.

@AlessioGr AlessioGr enabled auto-merge (squash) January 13, 2025 18:52
@AlessioGr AlessioGr merged commit 6757f7d into main Jan 13, 2025
67 checks passed
@AlessioGr AlessioGr deleted the feat/lexical-add-new-paragraph branch January 13, 2025 19:08
Copy link
Contributor

🚀 This is included in version v3.17.0

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.

Difficulties to add text after a block node at the end
3 participants