Skip to content

Commit fd1cd30

Browse files
committed
Fix closing tab
1 parent 126d29e commit fd1cd30

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

app/components/Tab.vue

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
<template>
22
<div
33
@click="$emit('navigate')"
4-
class="group relative flex h-7 min-w-[120px] max-w-[200px] cursor-pointer select-none items-center rounded-lg transition-all"
4+
class="animate-tab-in group relative flex h-7 min-w-[120px] max-w-[200px] cursor-pointer select-none items-center rounded-lg transition-all"
55
:class="[
6-
closing ? 'animate-tab-out' : animatingIn ? 'animate-tab-in' : '',
76
active
87
? 'z-10 bg-white/80 text-zinc-900 shadow-sm backdrop-blur-xl dark:bg-zinc-800/80 dark:text-zinc-100'
98
: 'text-zinc-500 hover:bg-white/40 hover:text-zinc-700 dark:text-zinc-400 dark:hover:bg-zinc-800/30 dark:hover:text-zinc-300',
@@ -61,7 +60,7 @@
6160
</template>
6261

6362
<script setup>
64-
import { ref, toRefs, nextTick, onMounted } from 'vue';
63+
import { ref, toRefs, nextTick } from 'vue';
6564
import { XIcon } from 'lucide-vue-next';
6665
6766
const props = defineProps({
@@ -77,18 +76,10 @@ const { name } = toRefs(props);
7776
const titleInput = ref(null);
7877
const localName = ref(name.value);
7978
const editingName = ref(false);
80-
const closing = ref(false);
81-
const animatingIn = ref(true);
82-
83-
onMounted(() => {
84-
setTimeout(() => animatingIn.value = false, 200);
85-
});
86-
8779
function close() {
8880
if (props.modified && !confirm('Close this project?')) return;
8981
90-
closing.value = true;
91-
setTimeout(() => emit('close'), 150);
82+
emit('close');
9283
}
9384
9485
function save() {

0 commit comments

Comments
 (0)