Fix Et2VfsSelectDialog file selection needed double click to toggle

This commit is contained in:
nathan 2024-02-29 10:03:44 -07:00
parent 1d7ca88a1d
commit 5e6bc15887

View File

@ -534,6 +534,11 @@ export class Et2VfsSelectDialog
} }
} }
/**
* SearchMixin handles the actual selection, we just reject directories here.
*
* @param {MouseEvent} event
*/
handleFileClick(event : MouseEvent) handleFileClick(event : MouseEvent)
{ {
const target = event.target as HTMLElement; const target = event.target as HTMLElement;
@ -542,22 +547,13 @@ export class Et2VfsSelectDialog
if(file && !file.disabled) if(file && !file.disabled)
{ {
this.currentResult = file;
// Can't select a directory normally, can't select anything in "saveas" // Can't select a directory normally, can't select anything in "saveas"
if(file.value.isDir && this.mode != "select-dir" || this.mode == "saveas") if(file.value.isDir && this.mode != "select-dir" || this.mode == "saveas")
{ {
event.preventDefault();
event.stopPropagation();
return; return;
} }
if(this.multiple)
{
this.toggleResultSelection(file);
}
else
{
this.setSelectedFiles(file);
}
// Set focus after updating so the value is announced by screen readers // Set focus after updating so the value is announced by screen readers
//this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true })); //this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
} }