Commit 311b60b
authored
fix(ui): prevent accidental prompt clear from tab focus (#461)
## Summary
- Fixes #460 by changing the prompt control DOM order so tabbing from
the textarea reaches expand before clear.
- Clears prompt text through the textarea native delete path so
Cmd/Ctrl+Z can restore cleared text where the browser supports native
undo.
- Keeps the existing app-state fallback for environments where native
editing commands are unavailable or throw.
## Validation
- npm run typecheck --workspace @codenomad/ui
- Reviewed fallback behavior: `document.execCommand` is checked for
callability and wrapped in `try/catch`, so unavailable native editing
commands still fall back to app-state clearing.
## Manual QA Notes
- In a supported desktop/browser host: type text, click clear, then
press Cmd/Ctrl+Z and confirm text restores.
- Type text, press Tab and confirm focus moves to expand before clear;
pressing Tab again reaches clear.1 parent 283d3d7 commit 311b60b
1 file changed
Lines changed: 31 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
466 | 487 | | |
467 | | - | |
468 | | - | |
469 | 488 | | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
470 | 493 | | |
471 | 494 | | |
472 | 495 | | |
| |||
747 | 770 | | |
748 | 771 | | |
749 | 772 | | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
750 | 779 | | |
751 | 780 | | |
752 | 781 | | |
| |||
757 | 786 | | |
758 | 787 | | |
759 | 788 | | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | 789 | | |
767 | 790 | | |
768 | 791 | | |
| |||
0 commit comments