Commit 903ff33
committed
fix: properly focus password input on error without using $el or ref
- Removed `passwordInput` ref and reliance on `$el` to access the input field inside the `Input` component.
- Fixed `TypeError` caused by calling `focus()` on the component instance.
- Now focusing the password input via `formElement.password` in the form's submit error handler.
- Used `nextTick` to ensure the DOM is updated before focusing.
- This approach is cleaner, avoids reliance on component internals, and works reliably with shadcn-vue components.1 parent 83f0d35 commit 903ff33
1 file changed
+9
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
31 | 29 | | |
32 | 30 | | |
33 | 31 | | |
34 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
66 | 70 | | |
67 | 71 | | |
68 | 72 | | |
69 | | - | |
| 73 | + | |
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
| |||
0 commit comments