Skip to content

Commit

Permalink
Editable: set cursor onTap rather than onFocus
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-james committed Jan 3, 2025
1 parent 23ee553 commit 27dddfb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Editable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ const Editable = ({
if (
disabled ||
// dragInProgress: not sure if this can happen, but I observed some glitchy behavior with the cursor moving when a drag and drop is completed so check dragInProgress to be safe
(!globals.touching && !state.dragInProgress && !state.dragHold && (!editingOrOnCursor || !isVisible))
(isTouch && !globals.touching && !state.dragInProgress && !state.dragHold)
) {
// do not set cursor on hidden thought
e.preventDefault()
Expand All @@ -557,7 +557,7 @@ const Editable = ({

if (state.showLetterCase) dispatch(toggleLetterCase({ value: false }))
} else {
setCursorOnThought()
setCursorOnThought({ editing: editingOrOnCursor })

// When the the cursor is first set on a thought, prevent the default browser behavior to avoid activating edit mode.
// Do not reset until the long tap is definitely over.
Expand Down

0 comments on commit 27dddfb

Please sign in to comment.