Skip to content

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

Merged
etrepum merged 1 commit into
meta:mainfrom
keiseiTi:fix/block-element-cursor
Aug 3, 2024
Merged

etrepum merged 1 commit into
meta:mainfrom
keiseiTi:fix/block-element-cursor

Conversation

@keiseiTi

@keiseiTi keiseiTi commented Aug 1, 2024 •

Copy link
Copy Markdown
Contributor

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

@vercel

vercel Bot commented Aug 1, 2024 •

Copy link
Copy Markdown

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
Copy Markdown
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 [email protected]. Thanks!

@github-actions

github-actions Bot commented Aug 1, 2024

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
Contributor

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

@keiseiTi

keiseiTi commented Aug 3, 2024

Copy link
Copy Markdown
Contributor Author

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

@etrepum etrepum left a comment

Copy link
Copy Markdown
Collaborator

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 meta:main with commit 65bdd2c Aug 3, 2024
@ivailop7

ivailop7 commented Aug 4, 2024

Copy link
Copy Markdown
Collaborator

@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

etrepum commented Aug 4, 2024

Copy link
Copy Markdown
Collaborator

@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

etrepum commented Aug 4, 2024

Copy link
Copy Markdown
Collaborator

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

ivailop7 commented Aug 4, 2024

Copy link
Copy Markdown
Collaborator

@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

keiseiTi commented Aug 5, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 2900d5e3 Deployed Aug 1, 2024 by vercel[bot]
Preview – lexical — 2900d5e3 Deployed Aug 1, 2024 by vercel[bot]
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