SAP - Paste event doesn't work for web components
Categories
(Core :: DOM: Events, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox87 | --- | fixed |
People
(Reporter: martin.georgiev, Assigned: emilio)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36
Steps to reproduce:
Open the following example.
https://codesandbox.io/s/ui5-webcomponents-forked-gdqfh?file=/src/index.js
- Copy some text
- Paste it in the input from the example
Actual results:
The paste event is not fired, which is most probably some bubbling issue. This works in other browsers.
Expected results:
The paste event should be fired.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Reporter | ||
Updated•4 years ago
|
Assignee | ||
Comment 2•4 years ago
|
||
Seems the paste
event is composed in other browsers... What does the spec say?
Comment 3•4 years ago
•
|
||
AFAICT the clipboard spec does not say anything about shadow tree.
Comment 4•4 years ago
•
|
||
nsCopySupport::FireClipboardEvent
properly calls EventDispatcher::Dispatch
(and thus the internal element properly gets the event) so it's indeed something about bubbling. The spec says:
- If parent is a Window object, or parent is a node and target’s root is a shadow-including inclusive ancestor of parent, then:
- If isActivationEvent is true, event’s bubbles attribute is true, activationTarget is null, and parent has activation behavior, then set activationTarget to parent.
- Append to an event path with event, parent, null, relatedTarget, touchTargets, and slot-in-closed-tree.
It seems it should bubble to the host if I'm understanding it correctly.
Assignee | ||
Comment 5•4 years ago
|
||
Assignee | ||
Comment 6•4 years ago
|
||
This is only about whether the event is composed. The event is composed in chrome / safari, so we should be able to fix it like the patch I just attached, but it'd be nice to have some sort of spec reference?
Comment 7•4 years ago
•
|
||
Oh, TIL .composed
😅
Yes, the spec says it should be composed
.
The paste event bubbles, is cancelable, and is composed.
... which also applies to copy and cut events.
I think bug 1620420 reported this problem before.
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 10•4 years ago
|
||
Comment 12•4 years ago
|
||
bugherder |
Description
•