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

Note: remove asyncFocus, restore focus on create #2770

Conversation

ethan-james
Copy link
Collaborator

@ethan-james ethan-james commented Jan 14, 2025

Fixes #2691

Calling asyncFocus() was blurring the editable, setting editing to false and triggering the whole editable's onFocus routine which calls setCursorOnThought with no offset. Without asyncFocus(), the caret pops back up to the end of the thought when a note is deleted.

Notes were also failing to focus in certain situations such as the following:

  1. Delete an existing note (caret returns to main thought)
  2. Close the keyboard
  3. Create a note via gesture
  4. No caret, keyboard stays closed

Explicitly calling focus() on the node causes it to focus regardless of how many previous notes have been edited or deleted.

@trevinhofmann trevinhofmann self-assigned this Jan 15, 2025
@trevinhofmann trevinhofmann self-requested a review January 15, 2025 03:29
Copy link
Collaborator

@trevinhofmann trevinhofmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the pull request, @ethan-james. Focus after deleting (and recreating) notes appears to be working as expected on iOS Safari:

Demo 1
note-1.mp4
Demo 1
note-2.mp4

@raineorshine raineorshine merged commit 95f11b7 into cybersemics:main Jan 15, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

Caret disappears when note is created
3 participants