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

Increase delay for input refocus after backspace on Android #14

Merged

Conversation

sergeichestakov
Copy link
Contributor

Hey Marijn!

Following up on my bug report on some backspacing issues on Android here, these two commits seem to have helped:

however, when I was testing this locally on my Google Pixel running Android 10, the timeout for refocusing after backspace input wasn't quite long enough which led to the virtual keyboarding not reopening when it should have. I suspect for older, less powerful devices, the virtual keyboard takes longer to close which leads to the heuristic in the set timeout flaking.

Using the following minimal repro:

and linking a local version of @codemirror/view via yarn link, I was able to work around the issue by increasing the timeout from 50 to 100ms.

Additionally, I noticed that we can forego the blur/set timeout logic for the enter key which we're also processing in the beforeinput handler.

Think this should help address the above issue, although ideally we triage the root cause that causes the virtual keyboard to close in the first place.

@marijnh marijnh merged commit 521394f into codemirror:main Nov 4, 2021
@marijnh
Copy link
Member

marijnh commented Nov 4, 2021

Think this should help address the above issue, although ideally we triage the root cause that causes the virtual keyboard to close in the first place.

It seems to be some logic, intentional or not, that treats a cursor next to an uneditable node as being in uneditable context (and thus not needing a keyboard). It shouldn't be too hard to create a reproduction outside of CodeMirror and submit a bug report on https://bugs.chromium.org/p/chromium/issues/list (but those usually don't really get any useful reaction).

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.

2 participants