Skip to content

Commit b22cec8

Browse files
authored
Update Input.vue
Fix focus in delete-user modal
1 parent aba3270 commit b22cec8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

resources/js/components/ui/input/Input.vue

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const props = defineProps<{
99
class?: HTMLAttributes['class'];
1010
}>();
1111
12+
const input = ref<HTMLInputElement | null>(null);
13+
1214
const emits = defineEmits<{
1315
(e: 'update:modelValue', payload: string | number): void;
1416
}>();
@@ -17,10 +19,19 @@ const modelValue = useVModel(props, 'modelValue', emits, {
1719
passive: true,
1820
defaultValue: props.defaultValue,
1921
});
22+
23+
function focus() {
24+
input.value?.focus();
25+
}
26+
27+
defineExpose({
28+
focus,
29+
});
2030
</script>
2131

2232
<template>
2333
<input
34+
ref="input"
2435
v-model="modelValue"
2536
:class="
2637
cn(

0 commit comments

Comments
 (0)