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
6363| containerClasses | custom container classes | "" |
6464| containerStyles | custom inline container styles | "" |
6565| disableDefaultStyles | don't apply default styles to container | false |
66- | inputElement | reference to inputRef | undefined |
67-
66+ | inputElement | reference to inputElement | undefined |
6867| required | html5 required attribute added to input | false |
6968
7069### Events
Original file line number Diff line number Diff line change 6161
6262 // Fn for opening the file dialog programmatically
6363 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
6666 state .isFileDialogActive = true ;
67- inputRef .click ();
67+ inputElement .click ();
6868 }
6969 }
7070
214214
215215 // Files dropped keep input in sync
216216 if (event .dataTransfer ) {
217- inputRef .files = event .dataTransfer ? .files ;
217+ inputElement .files = event .dataTransfer ? .files ;
218218 }
219219
220220 state .acceptedFiles = acceptedFiles;
287287 // Execute the timeout only if the file dialog is opened in the browser
288288 if (state .isFileDialogActive ) {
289289 setTimeout (() => {
290- if (inputRef ) {
291- const { files } = inputRef ;
290+ if (inputElement ) {
291+ const { files } = inputElement ;
292292
293293 if (! files .length ) {
294294 state .isFileDialogActive = false ;
301301
302302 onDestroy (() => {
303303 // This is critical for canceling the timeout behaviour on `onWindowFocus()`
304- inputRef = null ;
304+ inputElement = null ;
305305 });
306306
307307 function onInputElementClick (event ) {
357357 tabindex= " -1"
358358 on: change= {onDropCb}
359359 on: click= {onInputElementClick}
360- bind: this = {inputRef }
360+ bind: this = {inputElement }
361361 style= " display: none;"
362362 / >
363363 < slot>
You can’t perform that action at this time.
0 commit comments