Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste event e.clipboardData.types not working with Firefox #27616

Open
damien-git opened this issue Oct 19, 2016 · 2 comments
Open

Paste event e.clipboardData.types not working with Firefox #27616

damien-git opened this issue Oct 19, 2016 · 2 comments
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@damien-git
Copy link

This code fails with Firefox (e is a paste event):
h.DataTransfer data = e.clipboardData; if (data.types.contains('text/html')) { ... }
Error: TypeError: t1.contains$1 is not a function
This looks like a bug in dart2js (getInterceptor does not recognize DOMStringList).

Using Firefox 49.0 and Dart 1.20.1.

@vsmenon vsmenon added web-libraries Issues impacting dart:html, etc., libraries library-html web-dart2js P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed web-libraries Issues impacting dart:html, etc., libraries library-html labels Oct 20, 2016
@travissanderson-wf
Copy link

I just ran into the same thing, I'm not seeing a way to even work around it when we know we're running in Firefox either. data.types prints to the console as [Object DOMStringList] which is the JS type, can't be cast to the Dart DomStringList type.

@travissanderson-wf
Copy link

fwiw, you can still query for specific known formats so if you know you're interested in plain text or HTML, that is still doable

@vsmenon vsmenon added the area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. label Jul 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-web Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants