Skip to content

Commit 3027021

Browse files
authored
refactor: improve edit filename ui (#178)
1 parent 01961a6 commit 3027021

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/editor/FileSelector.vue

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ function horizontalScroll(e: WheelEvent) {
132132
<div
133133
v-if="(pending === true && i === files.length - 1) || pending === file"
134134
class="file pending"
135+
:class="{ active: pending === file }"
135136
>
137+
<span class="file pending">{{ pendingFilename }}</span>
136138
<input
137139
v-model="pendingFilename"
138140
spellcheck="false"
@@ -196,6 +198,7 @@ function horizontalScroll(e: WheelEvent) {
196198
}
197199
198200
.file {
201+
position: relative;
199202
display: inline-block;
200203
font-size: 13px;
201204
font-family: var(--font-code);
@@ -213,18 +216,25 @@ function horizontalScroll(e: WheelEvent) {
213216
padding: 8px 10px 6px;
214217
line-height: 20px;
215218
}
219+
.file.pending span {
220+
min-width: 50px;
221+
min-height: 34px;
222+
padding-right: 32px;
223+
background-color: rgba(200, 200, 200, 0.2);
224+
color: transparent;
225+
}
216226
.file.pending input {
217-
width: 90px;
218-
height: 30px;
219-
line-height: 30px;
220-
outline: none;
221-
border: 1px solid var(--border);
222-
border-radius: 4px;
223-
padding: 0 0 0 10px;
224-
margin-top: 2px;
225-
margin-left: 6px;
227+
position: absolute;
228+
inset: 8px 7px auto;
229+
font-size: 13px;
226230
font-family: var(--font-code);
227-
font-size: 12px;
231+
line-height: 20px;
232+
outline: none;
233+
border: none;
234+
padding: 0 3px;
235+
min-width: 1px;
236+
color: inherit;
237+
background-color: transparent;
228238
}
229239
.file .remove {
230240
display: inline-block;

0 commit comments

Comments
 (0)