This repository was archived by the owner on Oct 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
src/DOM/HTML/Event/DragEvent Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11"use strict" ;
22
3- exports . files = function ( dataTransfer ) {
3+ exports . filesNullable = function ( dataTransfer ) {
44 return dataTransfer . files ;
55} ;
66
Original file line number Diff line number Diff line change 11module DOM.HTML.Event.DragEvent.DataTransfer
22 ( DataTransfer
33 , files
4+ , filesNullable
45 , types
56 ) where
67
8+ import Prelude
79import DOM.File.Types (FileList )
10+ import Data.Maybe (Maybe )
11+ import Data.Nullable (Nullable , toMaybe )
812
913foreign import data DataTransfer :: *
1014
1115-- | Contains a list of all the local files available on the data transfer.
1216-- | Empty if the drag operation doesn't involve dragging files.
13- foreign import files :: DataTransfer -> FileList
17+ -- |
18+ -- | It's possible that a drag operation may have null files, instead of an
19+ -- | empty file list. In these cases Nothing is returned.
20+ files :: DataTransfer -> Maybe FileList
21+ files = toMaybe <$> filesNullable
22+
23+ foreign import filesNullable :: DataTransfer -> Nullable FileList
1424
1525-- | Returns an array of data formats used in the drag operation.
1626-- | If the drag operation included no data, then the array is empty.
You can’t perform that action at this time.
0 commit comments