Closed makotokato closed 2 years ago
Hey,
if it is using the drag&drop API, it should be using insertFromDrop
. insertImage
doesn't exist. We have discussed having something like that in the past though but had no use case at the time. We'll put this on the agenda for the call on 2021-06-11.
Hey @gked . This is something you were thinking about a while ago I believe.
RESOLUTION from the Editing Meeting: clarify that image insertion is done via paste. Also, need to update CEDisabled where web devs need to understand what kind of paste it is (plain text vs image, vs other content).
BTW, @masayuki-nakano says in https://bugzilla.mozilla.org/show_bug.cgi?id=1718429,
Well, if it should be emulated as "paste" in HTMLEditor, should we fire paste event too?
Should we fire paste
event if we use a kind of paste input type?
Re-opening to ensure we capture the feedback about the paste
event made by @makotokato
WG Call: include a note in the spec (non-normative) about firing paste event as well in this scenario.
From the Editing WG call — for compatibility with existing web content (for instance, pages that listen for paste
events and iterate DataTransfer.files
), I think it would be beneficial for the user agent to handle inserting images in the same way as a normal paste.
For what it's worth, iOS has a very similar system-wide feature that allows users to insert Memojis stickers as images in editing contexts via the software keyboard — for compatibility with both web content and third party native apps, this is surfaced by low-level UI frameworks as a regular paste command.
I'm not sure who exactly had this action... @whsieh would you mind creating a PR for this?
I tested it - the paste event is fired before the beforeinput event on all four browsers.
Android's software keyboard has a feature to insert image (https://developer.android.com/guide/topics/text/image-keyboard).
When using this, what is
InputType
for inserting image? "insertImage
"?Also, Windows 10 21H2 will seem to have same feature using Drag&Drop related API.