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

iOS sometimes enter gets stuck #482

Closed
lishid opened this issue May 6, 2021 · 9 comments
Closed

iOS sometimes enter gets stuck #482

lishid opened this issue May 6, 2021 · 9 comments

Comments

@lishid
Copy link

@lishid lishid commented May 6, 2021

I suspect this is related to the auto-capitalization hacks happening when enter is being pressed.

RPReplay_Final1620293925.mp4
RPReplay_Final1620294580.mp4
@balance-wtf
Copy link

@balance-wtf balance-wtf commented May 6, 2021

Can confirm happens on iOS.

marijnh added a commit to codemirror/view that referenced this issue May 10, 2021
… on iOS

To avoid a browser bug where Enter no longer does anything.

FIX: Work around a Mobile Safari bug where, after backspacing out the last character on a
line, Enter didn't work anymore.

Issue codemirror/codemirror.next#482
@marijnh
Copy link
Member

@marijnh marijnh commented May 10, 2021

Strange issue—after the backspace it gets in a state where the selection, when inspected from JS, looks fine, but Enter does absolutely nothing (no mutations reported at all). Attached patch forces a selection reset in situations that look like this, and seems to resolve the problem.

@marijnh marijnh closed this May 10, 2021
@bushev
Copy link

@bushev bushev commented May 13, 2021

Hey @marijnh, sorry for bothering, but it looks like we have some issues on view0.18.12.

Problem: It's not possible to make a new line after a semicolon.

Demo: https://github.com/codemirror/codemirror.next/compare/master...bushev:bushev/typing-issue?expand=1

RPReplay_Final1620946642.MP4

marijnh added a commit to codemirror/view that referenced this issue May 17, 2021
…e on iOS

FIX: Work around an issue where, after some types of changes, Mobile Safari would
ignore Enter presses.

Issue codemirror/codemirror.next#482
@marijnh
Copy link
Member

@marijnh marijnh commented May 17, 2021

That appears to have been triggered by another situation (the editor mutating the DOM node that the selection points into). I was able to reuse a kludge for a different issue in Chrome, which occurs in the same circumstances. Could you see if attached patch helps for you?

@bushev
Copy link

@bushev bushev commented May 18, 2021

Hey @marijnh, I can confirm that the issue with adding a new line after a semicolon has been fixed. However, there are new issues:

  • When it's not possible to add a new line after removing a semicolon
  • The cursor is shown at the end of the line (it doesn't break the typing)

I suspect it might be related to the lint package.

Please, check out the video:

RPReplay_Final1621296950.MP4

marijnh added a commit to codemirror/view that referenced this issue May 18, 2021
marijnh added a commit to codemirror/view that referenced this issue May 18, 2021
They are now always triggered, even if the native behavior does
nothing (which seems to happen a lot, especially with enter) or
something completely nonsensical (which happens with backspace near
uneditable widgets).

Issue codemirror/codemirror.next#482

FIX: Make iOS enter and backspace handling more robust, so that platform
bugs are less likely to break those keys in the editor.
@marijnh
Copy link
Member

@marijnh marijnh commented May 18, 2021

That last problem was caused by the workaround for #481 . I've adjusted it in codemirror/view@8f6c989 .

Was still seeing some brokenness around backspace when lint widgets were involved, which prompted codemirror/view@83bfe61 -- an attempt to make enter/backspace handling more robust on iOS.

@bushev
Copy link

@bushev bushev commented May 18, 2021

Hey @marijnh,

I've tested view and lint from the main branches, and I'm still observing the following issue. After a semicolon removal, I can't add a new line.

RPReplay_Final1621296950.MP4

@marijnh
Copy link
Member

@marijnh marijnh commented May 19, 2021

I didn't manage to reproduce that. I don't have the Java linter you appear to be using, and creating a similar situation in JavaScript didn't cause the issue.

@bushev
Copy link

@bushev bushev commented May 26, 2021

Yeah, fortunately, I'm not able to reproduce it too on a fresh build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants