W3C home > Mailing lists > Public > public-html@w3.org > April 2015

[drag-and-drop] include Range of drop target in drag and drop events

From: Olivier Forget <teleclimber@gmail.com>
Date: Sun, 19 Apr 2015 00:08:09 +0000
Message-ID: <CAA5DY6bQKB+qK54Tbm0FpXMnU=6+fyH7YTFcUM5=iAN7Xf8a5w@mail.gmail.com>
To: public-html@w3.org
Hi,

I'm playing around with drag-and drop in rich text editor. The drop event
gives me quite a bit of information on "where" the drop event occurred
(clientX/Y, target element, etc...), but the event doesn't tell me the most
important thing I need to know for dropping in text.

If I drag content from a text editor onto text that is in my text editor (a
contentEditable element) the system draws a caret in the editor text where
the dragged text will be inserted. This caret is *not* window.selection,
it's something else, but so far I and other devs can't figure out how to
get the position (as in Range) of that very important thing.

It seems the drag and drop events should tell us where within text the drop
is happening? Or is there a reason why it shouldn't? Can this be changed?

Thanks,

Oliver.
Received on Sunday, 19 April 2015 00:38:20 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 29 October 2015 10:16:43 UTC