codemirror / dev

Development repository for the CodeMirror editor project
https://codemirror.net/
Other
5.76k stars 368 forks source link

iOS autocorrect causes duplicate line break #1349

Closed itzTheMeow closed 6 months ago

itzTheMeow commented 7 months ago

Describe the issue

When typing in the editor with autocorrect enabled and the last word on the line is spelled incorrectly pressing return inserts 2 line breaks and does not autocorrect the word Screen recording explains it better

https://github.com/codemirror/dev/assets/50887230/fa63d0da-2cd8-4608-b272-413550a7e074

Instead of inserting 2 new lines it should autocorrect the word and insert 1 new line

Browser and platform

iOS Safari on 17.3.1

Reproduction link

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

marijnh commented 6 months ago

Attached patch should improve this.