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

[Mobile] Cursor set on wrong thought when siblings expand + collapse on tap #2804

Closed
raineorshine opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@raineorshine
Copy link
Contributor

raineorshine commented Feb 5, 2025

This is a regression from #2752.

Reproducible in Chrome device emulator.

Steps to Reproduce

- a
  - b
  - c
- New York
  - x
  - y
  - z
  1. Set the cursor on a
  2. Tap New York directly over the 'e'.

Current Behavior

The cursor is set to y.

Screen.Recording.2025-02-05.at.3.45.46.PM.mov

Expected Behavior

The cursor should be set to New York.

Notes

The problem seems to be related to the fastClick and stopPropagation that was added. If it is changed to a normal click, the problem goes away.

diff --git a/src/components/Editable.tsx b/src/components/Editable.tsx
index caeabf98d64..91139c1e113 100644
--- a/src/components/Editable.tsx
+++ b/src/components/Editable.tsx
@@ -612,8 +612,7 @@ const Editable = ({
       }
       placeholder={placeholder}
       // stop propagation to prevent default content onClick (which removes the cursor)
-      onClick={stopPropagation}
-      {...fastClick(onTap)}
+      onClick={onTap}
       // must call onMouseDown on mobile since onTap cannot preventDefault
       // otherwise gestures and scrolling can trigger cursorBack (#1054)
       onMouseDown={onTap}
@raineorshine raineorshine added the bug Something isn't working label Feb 5, 2025
@raineorshine raineorshine changed the title Cursor set on wrong thought when siblings expand + collapse on tap [Mobile] Cursor set on wrong thought when siblings expand + collapse on tap Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant