lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: After moving Selection, the small keyboard does not automatically pop up and cannot continue editing

Open sliyoxn opened this issue 6 months ago • 1 comments

Hello, I want to implement a custom image using DecoratorNode. However, I found that if there's only one Image node under the root element, it's quite difficult to insert content before or after it. I discovered that enabling the BlockCursor can solve this issue, but I encountered several strange behaviors during my usage:

  1. When clicking on the blank area of the editor, the BlockCursor does not appear automatically. It only appears if you select the image and then switch using the arrow keys.
  2. I tried using RangeSelection to show the editor's built-in BlockCursor, but I found that even though the BlockCursor moved to the correct position, I still couldn't input content (the virtual keyboard didn't pop up on mobile devices). Only after clicking again could I focus and input content.
  3. click image,the virtual keyboard did not pop up when focused

Steps To Reproduce

  • Go to demo
  • click insert image
  • click select prev
  • Type 'abcde'
  • click block cursor
  • Type 'abcde'
  • click other editor blank area,can't change block cursor position, It only appears if you select the image and then switch using the arrow keys.

Screenshots

pc: https://github.com/user-attachments/assets/b40c7863-eca5-4181-979e-3ac6048750c4 mobile: https://github.com/user-attachments/assets/eb32f292-2d0e-4098-9c30-adc264b00aee

Device Info

Smartphone: Device: Xiaomi14Pro OS: HyperOs 1.0.45 Browser: Chrome

Pc: Device: MacBook Pro 2021 OS: 14.4.1 Browser: Chrome 126.0.6478.183

The expected behavior

  • blockCursor can input text after update Selection
  • in mobile, when blockCursor show, virtual keyboard can pop up
  • when image selected, virtual keyboard can pop up
  • clicking on the blank area of the editor, the blockCursor can appear automatically

Impact of fix

Fixing this issue can improve the usability of custom nodes

sliyoxn avatar Aug 12 '24 05:08 sliyoxn