DataTransfer.items
Closed this issue · 1 comments
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-webprojects. 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
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?