New issue
Advanced search Search tips

Issue 882531 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Sep 26
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 2
Type: Bug



Sign in to add a comment

Input selectionStart does not reflect the drop events

Reported by biff.can...@gmail.com, Sep 10

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.81 Safari/537.36

Steps to reproduce the problem:
1. Create an input
2. Register handler for drop and dropover events
3. Observe selectionStart and selectionEnd properties of the input elements

What is the expected behavior?
The selectionStart and selectionEnd properties should reflect the current mouse position of the drop target

What went wrong?
The selectionStart and selectionStart are only updated after the drop event is handled by default handler, there is no easy way to cursor position of the drop.

Did this work before? No 

Chrome version: 69.0.3497.81  Channel: stable
OS Version: 10.0
Flash Version: 

There is no precise definition in HTML5 that the drop event should have a cursor position but it will be really nice if we have it like the system default handler has.
 
2018-09-10_chrome69_drop_cursor.swf
1.5 MB Download
drop_cursor_bug.html
734 bytes View Download
Steps to reproduce the problem:
1. Create an input
2. Create a div with some text
3. Register handler for drop and dropover events
4. Type in some text inside the input
5. Select any part of the text from the div
6. Drop the selected part to the input, don't release a mouse and move it over the text in the input
7. The browser displays you the cursor position inside the input at which the selected text will be placed at the end of the drop action
8. Observe selectionStart and selectionEnd properties of the input elements on drop and dropover events.

Components: -Blink Blink>Editing
Labels: Needs-Triage-M69
Components: -Blink>Editing Blink>Editing>Selection
Status: WontFix (was: Unconfirmed)
Mark WontFix since Chrome works as expected.

Drag-and-drop caret and selection caret are different entity. DnD-Caret doesn't move selection in text field.
So, then how to get DnD caret position just before the drop? Right now, it's only possible to get the selection after the native drop is completed, so taht, if we want restring the input with only letters and digits we cannot do it before the drop, only after it complets we could get the resulted value and remove the selection if it does not match the criteria. As I said initially this is not a big deal but it will be a nice future if it's possible to restrict the input before than making corrections after.

Sign in to add a comment