contenteditable element cannot delete a <br> tag if there is no leading + trailing characters |
||||||||
Issue descriptionFrom "Settings > About Chrome" Application version: any version OS: Android URLs (if applicable): https://jsfiddle.net/odcfngd0/ Steps to reproduce: 1. Type 'a' and then press enter key. 2. Press up arrow key, and then left arrow key. 3. Press backspace. (delete 'a') 4. Press backspace again. Expected result: The first backspace in step #3 should not delete the new line. The second backspace in step #4 should not delete anything. I should be able to delete everything, and resume the hint text. Actual result: The first backspace in step #3 deletes 'a' and also the new line after it. The second backspace in step #4 does not delete anything. After this, I cannot delete <br> tag using backspace. On desktop, we can remove <br> tag using backspace at step #4. <br> at the end of contenteditable gets systematically ignored - you cannot select it, and you cannot see it. Also, when you type an enter key, you get two <br> tags. If you type two enter keys, you get three <br> tags. Originally filed as b/27441950
,
Apr 7 2016
Hmm... I can either change InputMethodController to call deleteKeyPressed() in certain conditions, or change TypingCommand::deleteSelection() to behave differently. tkent@, it seems that TypingCommand::deleteKeyPressed() deletes the entire content when there is no visible position in the editing root, while that logic is missing in TypingCommand::deleteSelection(). Is this intended? If so, could you explain why it is designed this way?
,
Apr 7 2016
I mean touching the input form and move the cursor to in front of 'a'. Of course, you can pair a bluetooth keyboard to actually press arrow keys on Android.
,
Apr 7 2016
It sure sounds like a simple oversight to me. I'd go ahead and write the patch that adds the extra deletion behavior in deleteSelection(), and if that doesn't make any layout tests fail, it's probably good to go.
,
Apr 7 2016
,
Jun 22 2016
reassigning to yabinh@
,
Jul 13 2016
Talked to yabinh@ offline. It seems that Google IME (Latin, Korean, Indic) now sends backspace key instead of calling deleteSurroundingText() (probably as a workaround of this and other similar issues). Also Samsung IME always has been doing so. I think we should lower the priority of this bug unless there is a major IME who still calls deleteSurroundingText() in this situation. yabinh@, could you check?
,
Jul 13 2016
Only a few IME apps can't delete the <br> tag, like Marathi Input Keyboard(GrowUp Infotech), Indic Keyboard(Indic project). But they are not widely used. I haven't found any main IME apps that can't delete the <br> tag.
,
Jul 15 2016
Sounds good, deprioritizing.
,
Jun 8 2017
,
Aug 18 2017
I understand IMEs mostly do send backspace key for empty textboxes nowadays. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by lima...@gmail.com
, Apr 5 2016