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: text selection after input confirmation inside parentheses #1443

Open
ina-yuzen opened this issue Sep 20, 2024 · 1 comment
Open

iOS: text selection after input confirmation inside parentheses #1443

ina-yuzen opened this issue Sep 20, 2024 · 1 comment

Comments

@ina-yuzen
Copy link

ina-yuzen commented Sep 20, 2024

Describe the issue

When using iOS, if the cursor is placed inside parentheses and a character with composition is entered just before the closing parenthesis, upon confirming the input, the entered character becomes selected. As a result, when typing the next character, the previously entered text gets deleted.

RPReplay_Final1726839505.mov

This seems to happen when bracketMatching extension is enabled.

Browser and platform

iPad Pro 3rd gen, iOS 16.6, Safari/Chrome 129.0.6668.46

Reproduction link

https://codemirror.net/try/?c=aW1wb3J0IHtiYXNpY1NldHVwLCBFZGl0b3JWaWV3fSBmcm9tICJjb2RlbWlycm9yIgppbXBvcnQge2JyYWNrZXRNYXRjaGluZ30gZnJvbSAiQGNvZGVtaXJyb3IvbGFuZ3VhZ2UiCgppbXBvcnQge2phdmFzY3JpcHR9IGZyb20gIkBjb2RlbWlycm9yL2xhbmctamF2YXNjcmlwdCIKCm5ldyBFZGl0b3JWaWV3KHsKICBkb2M6ICIoKVxuIiwKICBleHRlbnNpb25zOiBbYnJhY2tldE1hdGNoaW5nKCldLAogIHBhcmVudDogZG9jdW1lbnQuYm9keQp9KQo=

@ina-yuzen ina-yuzen changed the title iOS: text deletion after input confirmation inside parentheses iOS: text selection after input confirmation inside parentheses Sep 20, 2024
@ina-yuzen
Copy link
Author

After testing the demo for a while, I noticed the following behavior on iOS when entering Japanese text:

  1. When typing Japanese, the input string is first highlighted (selected), and then the cursor moves to the position immediately after the entered text.
  2. Additionally, I observed that when the decoration immediately following the input text disappears, the behavior of the selection range changes.

Since the bracketMatching feature relies on the selection range to determine whether to highlight brackets, this sequence of events causes a brief flicker in the bracket highlighting. Specifically, when the entered text is initially selected, the bracket highlighting disappears, but it reappears once the cursor moves to the position after the text.

It seems this appearance and disappearance of the decoration is causing the selection range to behave inconsistently. While I'm still unsure what exactly happens when the input string is finalized, I hope these observations are helpful.

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

No branches or pull requests

1 participant