Closed Bug 1784216 Opened 3 years ago Closed 3 years ago

Paste plain (Paste without format) not work for textarea (or textfields) but fire events in outer element

Categories

(Core :: DOM: Editor, defect)

Firefox 102
defect

Tracking

()

RESOLVED DUPLICATE of bug 968104

People

(Reporter: msuhr, Unassigned)

Details

Steps to reproduce:

Try to paste plain text (ctrl/Cmd + Shift + V) into a plain textarea (or input type="text") will not paste any content into the box.

This maybe indented, but if you put the textarea into an contenteditable div the paste event is bubbled to the outer div. This looks like strange behaviour because the paste is not handle by the current focussed textarea.

sample: https://jsfiddle.net/t92bxj0w/

Actual results:

Text is pasted into the contenteditable div

Expected results:

Either no paste event at all
or
Paste without format works for textarea

Tested with Firefox ESR 102.0.1esr

The Bugbug bot thinks this bug should belong to the 'Core::DOM: Editor' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → DOM: Editor
Product: Firefox → Core

I got different results from comment 0 when I tried to reproduce this on Win11. I also got different results on various channels.

On Release Fx 103 and ESR 102, -
When I tried to paste plain text (ctrl/Cmd + Shift + V) into a plain textarea ("normal textarea" in this example), nothing was pasted into the textarea.
When I tried to paste the plain text into the textarea, which is inside an contenteditable element, text was pasted into the contenteditable div instead. There was no paste event at all.

On Nightly 105 & Chrome 104 -
When I tried to paste plain text (ctrl/Cmd + Shift + V) into a plain textarea ("normal textarea" in this example), text was pasted into the box.
When I tried to paste the plain text into the textarea, which is inside an contenteditable element, text was pasted into the the textarea itself. Event was dispatched as well.

What's the expected behavior here? Why are we seeing different results on nightly and ESR?

Flags: needinfo?(echen)

In my opinion the nightly feature seems the expected one. Then it works like in Chrome.

But I don't know what was originally the expected behaviour.

in 104.0b9 Developer build it also seems to be fixed (if paste plain text should supported). Like :hsinyi said in Nightly 105

Bug 968104 adds the support of plain text paste on plain text editor which also fixes this issue.

Status: UNCONFIRMED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(echen)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.