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

Cursor not showing in the editor when clicking on <h1> element #9

Open
ALEXDINO7 opened this issue Dec 20, 2024 · 5 comments
Open

Cursor not showing in the editor when clicking on <h1> element #9

ALEXDINO7 opened this issue Dec 20, 2024 · 5 comments

Comments

@ALEXDINO7
Copy link

ALEXDINO7 commented Dec 20, 2024

I tested the Lexical Playground, and when I click on an

element, the cursor appears in the editor. However, in your example, the cursor does not appear when clicking on the

element. Could you clarify why this is happening?

@ALEXDINO7 ALEXDINO7 changed the title The cursor not show when i click for example H1 Cursor not showing in the editor when clicking on <h1> element Dec 20, 2024
@htmujahid
Copy link
Owner

could you please elaborate, what issue are you facing

@ALEXDINO7
Copy link
Author

could you please elaborate, what issue are you facing

in the lexical official playground when you select for example H1 the cursor automatically shows inside the editor

but in your version the cursor is not show until you click again inside the editor its not good for Ux

@htmujahid
Copy link
Owner

It's due to the way how shadcn tooltip works. But nice catch, working on it.

@ALEXDINO7
Copy link
Author

It's due to the way how shadcn tooltip works. But nice catch, working on it.

you can see this repo https://github.com/mohe22/Next-lexical-editor

but I don't know if he use shadcn or not

@Shuffled720
Copy link

one can use useRef to track the cursor position and restore it

  1. Track the Cursor Position: Use the onClick or onInput event to track the cursor position in the input field.
  2. Restore the Cursor Position: After selecting an option, restore the focus to the input box and set the cursor position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants