w3c / input-events

Input Events
https://w3c.github.io/input-events/
Other
23 stars 16 forks source link

InputType to insert image from software keyboard #117

Closed makotokato closed 2 years ago

makotokato commented 3 years ago

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.

johanneswilm commented 3 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.

johanneswilm commented 3 years ago

Hey @gked . This is something you were thinking about a while ago I believe.

gked commented 3 years ago

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).

makotokato commented 2 years ago

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?

travisleithead commented 2 years ago

Re-opening to ensure we capture the feedback about the paste event made by @makotokato

travisleithead commented 2 years ago

WG Call: include a note in the spec (non-normative) about firing paste event as well in this scenario.

whsieh commented 2 years ago

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.

travisleithead commented 2 years ago

I'm not sure who exactly had this action... @whsieh would you mind creating a PR for this?

johanneswilm commented 2 years ago

I tested it - the paste event is fired before the beforeinput event on all four browsers.