Fixed filename not showing in file selector in non-tabbed input
This commit is contained in:
		| @@ -19,9 +19,10 @@ function sendValue() { | ||||
|     emit('update', data.value) | ||||
| } | ||||
|  | ||||
| function updateData(newData: string) { | ||||
| function updateData(newData: string, clearFileSelector: boolean = true) { | ||||
|     data.value = newData | ||||
|     inputFile.value.value = '' | ||||
|     if (clearFileSelector) | ||||
|         inputFile.value.value = ''; | ||||
|     sendValue() | ||||
| } | ||||
|  | ||||
| @@ -39,9 +40,9 @@ function readFile(file : any) { | ||||
|      | ||||
|     const reader = new FileReader() | ||||
|     reader.onloadend = () => { | ||||
|         var result = reader.result?.toString() | ||||
|         let result = reader.result?.toString() | ||||
|         if (typeof result == "string") | ||||
|             updateData(result) | ||||
|             updateData(result, false); | ||||
|              | ||||
|     } | ||||
|     reader.readAsText(file.target.files[0]) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user