You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: Gboard causes cursor to jump back when navigating #3538
When attempting to move the cursor, it jumps back to the current location immediately. Doesn't happen if the cursor is at the end of a line, doesn't happen if the keyboard is minimized.
Only happens if Gboard is enabled. Tested it on 3 different Android phones, all had the same behavior. Not sure if it happens on iOS as well.
Thanks for that. Looking at the diff between 0.4 and 0.3.9, the one thing that stands out to me was logic around handling mousedown – which I assume might be occurring on Android when moving selection around. Specifically this:
I wonder if you can test locally disabling this logic (i.e. comment out that function). If that solves it, then I think the best plan of action is to switch from using the mousedown event to using the pointerdown event – which allows us to detect if the input type is mouse or touch (this logic is only meant for mouse users I believe).
cc @zurfyx this might be a regression introduced in #2901.
Activity
trueadm commentedon Dec 12, 2022
Did this happen in earlier versions of Lexical?
Spencer-Sleep commentedon Dec 12, 2022
It looks like this was introduced in 0.4.0 - it's not an issue in 0.3.11 but occurs in later versions.
trueadm commentedon Dec 12, 2022
Thanks for that. Looking at the diff between 0.4 and 0.3.9, the one thing that stands out to me was logic around handling mousedown – which I assume might be occurring on Android when moving selection around. Specifically this:
https://github.com/facebook/lexical/blob/main/packages/lexical/src/LexicalEvents.ts#L382-L394
I wonder if you can test locally disabling this logic (i.e. comment out that function). If that solves it, then I think the best plan of action is to switch from using the
mousedownevent to using thepointerdownevent – which allows us to detect if the input type is mouse or touch (this logic is only meant for mouse users I believe).cc @zurfyx this might be a regression introduced in #2901.
thegreatercurve commentedon Dec 12, 2022
This seems to be a Chromium specific bug. Tested on Firefox on Android and it works fine.
trueadm commentedon Dec 12, 2022
@thegreatercurve if you make the change I mention above and comment out that function, does it resolve the problem?
Spencer-Sleep commentedon Dec 12, 2022
@trueadm removing that event handler does fix the issue
thegreatercurve commentedon Dec 12, 2022
@trueadm It does indeed! Need to check for the
pointerTypeas well, aspointerdownfires on mobile as well.#3541 should close the issue.
reymon359 commentedon Mar 27, 2023
Hey there 👋🏽
I am facing a very similar issue in my app, and I am using version
"lexical": "0.7.6"when I click in the end of a word/line, it jumps to the beginning of it
Here is an example with the lexical playground
video5838997340148469461.mp4
I am using a Google Pixel android phone with Gboard
Do you have any idea on how to fix it?
Did you make any change related to the code recently that may be causing this?
reymon359 commentedon Mar 27, 2023
Btw, I created an issue for the above #4207