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

[@lexical/playground] fix: block cursor show horizontal #6486

Merged
merged 1 commit into from
Aug 3, 2024

Conversation

keiseiTi
Copy link
Contributor

@keiseiTi keiseiTi commented Aug 1, 2024

Description

Describe the changes in this pull request

fix lexical PlaygroundEditor Theme blockCursor show

RE #6459

iShot_2024-08-01_23 11 31

Test plan

Before

Insert relevant screenshots/recordings/automated-tests

not need test

After

Insert relevant screenshots/recordings/automated-tests

not need test

Copy link

vercel bot commented Aug 1, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lexical ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2024 3:16pm
lexical-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2024 3:16pm

@facebook-github-bot
Copy link
Contributor

Hi @keiseiTi!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks!

Copy link

github-actions bot commented Aug 1, 2024

size-limit report 📦

Path Size
lexical - cjs 29.05 KB (0%)
lexical - esm 28.86 KB (0%)
@lexical/rich-text - cjs 37.39 KB (0%)
@lexical/rich-text - esm 28.33 KB (0%)
@lexical/plain-text - cjs 36.02 KB (0%)
@lexical/plain-text - esm 25.6 KB (0%)
@lexical/react - cjs 39.29 KB (0%)
@lexical/react - esm 29.77 KB (0%)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 2, 2024
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@potatowagon
Copy link
Contributor

could we have some screenshots to highlight the differences in the before & after please?

@keiseiTi
Copy link
Contributor Author

keiseiTi commented Aug 3, 2024

could we have some screenshots to highlight the differences in the before & after please?

Before

iShot_2024-08-03_10 47 42

After

iShot_2024-08-01_23 11 31

Copy link
Collaborator

@etrepum etrepum left a comment

Choose a reason for hiding this comment

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

I changed the PR description because this does not close #6459 (the table cell is still deleted) but it does fix the cursor display

@etrepum etrepum added this pull request to the merge queue Aug 3, 2024
Merged via the queue into facebook:main with commit 65bdd2c Aug 3, 2024
40 of 41 checks passed
@ivailop7
Copy link
Collaborator

ivailop7 commented Aug 4, 2024

@etrepum, let's revert this one. The block cursor is intended to be an underline. This now brakes when you have a table as first cell and move the cursor before the table. The reason it only works for the horizontal line is because of the CSS margins.

@etrepum
Copy link
Collaborator

etrepum commented Aug 4, 2024

@ivailop7 It looks like it works to me? This is playground css so if a user has their own css that would make this hard to see (e.g. table border of the same color) they could change it accordingly

vertical-cursor.mov

@etrepum
Copy link
Collaborator

etrepum commented Aug 4, 2024

Another RTE that I could find that supported this state had similar tall vertical cursor behavior next to a table: https://richtexteditor.com/Demos/table-support.aspx

Although this one has an underline cursor above the table
https://prosemirror-tables.netlify.app/

The other editors I could find wouldn't let you get into that selection state

@ivailop7
Copy link
Collaborator

ivailop7 commented Aug 4, 2024

@ivailop7 It looks like it works to me? This is playground css so if a user has their own css that would make this hard to see (e.g. table border of the same color) they could change it accordingly

vertical-cursor.mov

Press up from that position.

@keiseiTi
Copy link
Contributor Author

keiseiTi commented Aug 5, 2024

This is the editor of Yuque (a Chinese document website), and the cursor of the horizontal line in its table looks like this.

I also tried other editor interactions and they all seemed to behave differently. So it depends on how you define the interaction.

iShot_2024-08-05_09 51 08

@turnerguo
Copy link
Contributor

https://prosemirror-tables.netlify.app/
I think ProseMirror's cursor intension is much more clear.
For Horizontal Line it should be a horizontal cursor their.

jkjk822 pushed a commit to jkjk822/lexical that referenced this pull request Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants