mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:15 +01:00
Et2VfsSelectDialog: In Save As mode, selecting a file changes filename to the selected name
Plus some vertical spacing fixes
This commit is contained in:
parent
b429434010
commit
1bfd3ac6fe
@ -8,6 +8,7 @@ export default css`
|
||||
et2-dialog::part(body) {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: var(--sl-spacing-small);
|
||||
}
|
||||
|
||||
.et2_toolbar {
|
||||
|
@ -33,7 +33,7 @@ When the user closes the dialog, getComplete() will return the selected files.
|
||||
|
||||
```js
|
||||
const dialog = this.et2.getWidgetById("files");
|
||||
let files = await dialog.getComplete();
|
||||
let [button, files] = await dialog.getComplete();
|
||||
```
|
||||
|
||||
This is probably the best way to get files (or directories) that you then want to do something with on the client. See
|
||||
|
@ -583,13 +583,22 @@ export class Et2VfsSelectDialog
|
||||
|
||||
if(file && !file.disabled)
|
||||
{
|
||||
// Can't select a directory normally, can't select anything in "saveas"
|
||||
if(file.value.isDir && this.mode != "select-dir" || this.mode == "saveas")
|
||||
// Can't select a directory normally
|
||||
if(file.value.isDir && this.mode != "select-dir")
|
||||
{
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
// can't select anything in "saveas", but set the file name
|
||||
else if(this.mode == "saveas")
|
||||
{
|
||||
this._filenameNode.value = file.value.name;
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.updateComplete.then(() => this._filenameNode.focus());
|
||||
return;
|
||||
}
|
||||
// Set focus after updating so the value is announced by screen readers
|
||||
//this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user