File tree Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Expand file tree Collapse file tree 1 file changed +21
-11
lines changed Original file line number Diff line number Diff line change @@ -90,6 +90,11 @@ function customize() {
90
90
isCustomizing = false
91
91
}
92
92
93
+ function resetTitle() {
94
+ customTitle = title
95
+ isCustomizing = false
96
+ }
97
+
93
98
function autoselect(event : FocusEvent ) {
94
99
(event .target as HTMLInputElement ).select ()
95
100
}
@@ -135,17 +140,17 @@ function close() {
135
140
/>
136
141
<VisualIcon v-else-if =" pane && tab!.shell" name =" lucide-file" class =" tab-icon" />
137
142
<VisualIcon v-else name =" lucide-terminal" class =" tab-icon" />
138
- <input
139
- v-if = " isCustomizing "
140
- ref =" customTitleElement"
141
- v-model =" customTitle"
142
- autofocus
143
- class =" custom-tab-name"
144
- @focus =" autoselect"
145
- @blur =" customize"
146
- @keydown.enter = " customize "
147
- @keydown.esc = " customize "
148
- >
143
+ <form v-if = " isCustomizing " class = " tab-name-form " @submit.prevent = " customize " >
144
+ < input
145
+ ref =" customTitleElement"
146
+ v-model =" customTitle"
147
+ autofocus
148
+ class =" custom-tab-name"
149
+ @focus =" autoselect"
150
+ @blur =" customize"
151
+ @keydown.esc = " resetTitle "
152
+ >
153
+ </ form >
149
154
<span v-else class =" tab-name" @click =" startCustomization" >{{ customTitle }}</span >
150
155
</div >
151
156
<div class =" right-side" >
@@ -211,6 +216,11 @@ function close() {
211
216
overflow : hidden ;
212
217
transition : color 0.2s ;
213
218
}
219
+ .tab-name-form {
220
+ display : flex ;
221
+ flex : 1 ;
222
+ min-width : 0 ;
223
+ }
214
224
.custom-tab-name {
215
225
flex : 1 ;
216
226
min-width : 0 ;
You can’t perform that action at this time.
0 commit comments