disable create directory button if no input
This commit is contained in:
@@ -15,6 +15,9 @@ const dialog = useCreateDirectoryDialog();
|
||||
|
||||
const creating = ref(false);
|
||||
const directoryName = ref('');
|
||||
const directoryNameValid = computed(
|
||||
() => directoryName.value.trim().length > 0
|
||||
);
|
||||
|
||||
async function submit() {
|
||||
creating.value = true;
|
||||
@@ -59,7 +62,11 @@ async function submit() {
|
||||
/>
|
||||
|
||||
<DialogFooter>
|
||||
<Button :disabled="creating" @click="submit">Create</Button>
|
||||
<Button
|
||||
:disabled="!directoryNameValid || creating"
|
||||
@click="submit"
|
||||
>Create</Button
|
||||
>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
Reference in New Issue
Block a user