fix: focus reanme and new dir,file inputs
This commit is contained in:
parent
0aedbbebac
commit
cf540481c2
@ -11,7 +11,7 @@
|
||||
type="text"
|
||||
@keyup.enter="submit"
|
||||
v-model.trim="name"
|
||||
v-focus
|
||||
ref="wantInput"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@ -61,6 +61,9 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(["isFiles", "isListing"]),
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => setTimeout(() => this.$refs.wantInput.focus(), 100))
|
||||
},
|
||||
methods: {
|
||||
submit: async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
<p>{{ $t("prompts.newFileMessage") }}</p>
|
||||
<input
|
||||
class="input input--block"
|
||||
v-focus
|
||||
ref="wantInput"
|
||||
type="text"
|
||||
@keyup.enter="submit"
|
||||
v-model.trim="name"
|
||||
@ -51,6 +51,9 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(["isFiles", "isListing"]),
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => setTimeout(() => this.$refs.wantInput.focus(), 100))
|
||||
},
|
||||
methods: {
|
||||
submit: async function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
@ -93,6 +93,7 @@ export default {
|
||||
computed: {
|
||||
...mapState(["plugins"]),
|
||||
...mapGetters(["currentPrompt", "currentPromptName"]),
|
||||
// yes, if the stack of modals/dialogs is not empty
|
||||
showOverlay: function () {
|
||||
return (
|
||||
this.currentPrompt !== null &&
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
</p>
|
||||
<input
|
||||
class="input input--block"
|
||||
v-focus
|
||||
ref="wantInput"
|
||||
type="text"
|
||||
@keyup.enter="submit"
|
||||
v-model.trim="name"
|
||||
@ -59,6 +59,10 @@ export default {
|
||||
...mapState(["req", "selected", "selectedCount"]),
|
||||
...mapGetters(["isListing"]),
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => setTimeout(() => this.$refs.wantInput.focus(), 100))
|
||||
},
|
||||
|
||||
methods: {
|
||||
cancel: function () {
|
||||
this.$store.commit("closeHovers");
|
||||
|
||||
@ -9,6 +9,8 @@ const mutations = {
|
||||
state.show = null;
|
||||
state.showShell = !state.showShell;
|
||||
},
|
||||
// display a modal prompt or a dialog, such as when renaming a file
|
||||
// opinion: should be renamed to showPrompt or showDialog because "hover" means something else in HTML speak
|
||||
showHover: (state, value) => {
|
||||
if (typeof value !== "object") {
|
||||
state.prompts.push({
|
||||
@ -21,7 +23,7 @@ const mutations = {
|
||||
}
|
||||
|
||||
state.prompts.push({
|
||||
prompt: value.prompt, // Should not be null
|
||||
prompt: value.prompt, // Should not be null ('newDir', 'newFile', etc)
|
||||
confirm: value?.confirm,
|
||||
action: value?.action,
|
||||
props: value?.props,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user