Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSelecting text in a text input deletes text instead #22345
Comments
|
I can't seem to replicate this on my computer (08bbf4f on Debian testing). The characters are selected and don't appear to be deleted. |
|
Maybe it's a macOS-only issue? |
I think so, I can reproduce this on my mac |
|
Yes, I can reproduce this bug in my Mac Pro. I want to participate in this task, can you assign it to me? |
|
After adding some When I use shift+left to select, the logs show that it received these key events.
But U+F702 is Private Use Area in Unicode, it's weird. |
|
After testing in my Ubuntu, I didn't see any strange characters. Instead, I found all the arrow keys, F1-F12 keys, HOME, PgUp, PgDn, End, Delete will emit those strange Unicode, which overwrites the original characters. And those characters are not visible, so it seems you delete the characters. OK, I have verified my guess. When you use an arrow key, it will insert an invisible characters and overwrite the original one.
|
|
With debugging with lldb, I found the strange character event exists in Could you please give me some advice? Here are the call stacks when handle_keydown is called.
|
|
Key input starts in servo/ports/servo/glutin_app/window.rs Lines 426 to 440 in d44e9ac servo/components/script/script_thread.rs Lines 3048 to 3054 in d44e9ac |
|
Now I think it may be an upstream related problem? Anyway, I will check the upstream project, glutin. |
|
OK, I am sure it is an upstream related issue. When I press Left Arrow in the demo window, I have found these logs in it.
According to my tests, this bug does not exist with linux. So what should I do now? Do you need me to ask an issue to help them fix the bug? Or just close our issue? |
|
Filing an issue in the upstream repository with a simple testcase would be useful. We should leave this issue open until it's fixed, though. |
|
That being said, the ReceivedCharacter handling is this code, so it still might be our fault. |
|
Or possibly https://github.com/tomaka/winit/blob/8e733543cdc1c8b0ab4172f3fd2d9ef98b23dce1/src/platform/macos/view.rs#L352-L392 judging by the comment about human readable characters. |
|
Please note that #22344 is extremely likely to be due to this extra event as well. |
|
Yes, I also realized that it was a problem there, but how fast you are! We can, of course, fix this problem. But I think the point is the different behavior on OS X of the library, I believe this is also a problem. But no matter what, I am willing to contribute code to Servo, so do I need to fix it in Servo? |
Yes, I think their reasons should be similar. |
|
We should try to fix it upstream, rather than working around it in Servo. |
|
OK, I will file an issue in the upstream repository. |
|
Here is the upstream issue. |
|
Upstream issue is closed but this is still happening on macOS 10.15.6 |
|
It's possible that we still have not updated to a recent version of winit that includes the fix. |
|
That issue looks to have been fixed in winit 0.20 and Servo is still using 0.19.3. winit update issue: #26394 |
./mach run -d 'data:text/html,<input value="hi">'Focus the text input with the mouse, then use shift+left to select the previous character. Instead the character appears to be deleted. We should start by determining if the code to recognise shift is working, then figure out why the horizontal adjustment code is behaving strangely.