File tree Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Expand file tree Collapse file tree 2 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,7 @@ yarn add svelte-file-dropzone
63
63
| containerClasses | custom container classes | "" |
64
64
| containerStyles | custom inline container styles | "" |
65
65
| disableDefaultStyles | don't apply default styles to container | false |
66
- | inputElement | reference to inputRef | undefined |
67
-
66
+ | inputElement | reference to inputElement | undefined |
68
67
| required | html5 required attribute added to input | false |
69
68
70
69
### Events
Original file line number Diff line number Diff line change 61
61
62
62
// Fn for opening the file dialog programmatically
63
63
function openFileDialog () {
64
- if (inputRef ) {
65
- inputRef .value = null ; // TODO check if null needs to be set
64
+ if (inputElement ) {
65
+ inputElement .value = null ; // TODO check if null needs to be set
66
66
state .isFileDialogActive = true ;
67
- inputRef .click ();
67
+ inputElement .click ();
68
68
}
69
69
}
70
70
214
214
215
215
// Files dropped keep input in sync
216
216
if (event .dataTransfer ) {
217
- inputRef .files = event .dataTransfer ? .files ;
217
+ inputElement .files = event .dataTransfer ? .files ;
218
218
}
219
219
220
220
state .acceptedFiles = acceptedFiles;
287
287
// Execute the timeout only if the file dialog is opened in the browser
288
288
if (state .isFileDialogActive ) {
289
289
setTimeout (() => {
290
- if (inputRef ) {
291
- const { files } = inputRef ;
290
+ if (inputElement ) {
291
+ const { files } = inputElement ;
292
292
293
293
if (! files .length ) {
294
294
state .isFileDialogActive = false ;
301
301
302
302
onDestroy (() => {
303
303
// This is critical for canceling the timeout behaviour on `onWindowFocus()`
304
- inputRef = null ;
304
+ inputElement = null ;
305
305
});
306
306
307
307
function onInputElementClick (event ) {
357
357
tabindex= " -1"
358
358
on: change= {onDropCb}
359
359
on: click= {onInputElementClick}
360
- bind: this = {inputRef }
360
+ bind: this = {inputElement }
361
361
style= " display: none;"
362
362
/ >
363
363
< slot>
You can’t perform that action at this time.
0 commit comments