Skip to content

DataTransfer.items #54

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

Closed
1 task done
pete-murphy opened this issue Mar 15, 2021 · 1 comment · Fixed by #55
Closed
1 task done

DataTransfer.items #54

pete-murphy opened this issue Mar 15, 2021 · 1 comment · Fixed by #55
Labels
type: enhancement A new feature or addition.

Comments

@pete-murphy
Copy link
Contributor

pete-murphy commented Mar 15, 2021

Prerequisites

  • Before opening an issue, please check the HTML standard (https://html.spec.whatwg.org). If it doesn't appear in this spec, it may be present in the spec for one of the other purescript-web projects. Although MDN is a great resource, it is not a suitable reference for this project.

Description

I recently had a use case for the DataTransfer.items method to detect MIME types of dragged files on an onDragEnter event listener (DataTransfer.files returns an empty array when dragging). Would this be something that would be a welcome addition?

HTML Standard Reference

https://html.spec.whatwg.org/#dom-datatransfer-items

First pass at an implementation (currently with no documentation)

https://github.com/ptrfrncsmrph/jira-dependencies-frontend/tree/main/src/Web/HTML/Event/DataTransfer

@pete-murphy pete-murphy added the type: enhancement A new feature or addition. label Mar 15, 2021
@pete-murphy
Copy link
Contributor Author

I'm sure I'd need to fix this before opening a PR 🙈 https://github.com/ptrfrncsmrph/jira-dependencies-frontend/blob/3c63761cb626aba7e04b65ce9234ff52186bd32c/src/Web/HTML/Event/DataTransfer/DataTransferItem.purs#L31-L41.
Unclear of FFI best practice here, if the spec says it must be one of "string" or "file", should this be String on the PureScript side? or Maybe DataTransferItemKind?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A new feature or addition.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant