🐛(frontend) preserve typed text after @ on escape

prevents losing input when closing interlink search
This commit is contained in:
Cyril
2026-01-27 15:10:22 +01:00
parent 325c7d9786
commit 781f0815a8
2 changed files with 3 additions and 2 deletions

View File

@@ -26,6 +26,7 @@ and this project adheres to
- 🐛(frontend) add fallback for unsupported Blocknote languages #1810
- 🐛(frontend) fix emojipicker closing in tree #1808
- 🐛(frontend) display children in favorite #1782
- 🐛(frontend) preserve typed text after @ on escape #1833
### Removed

View File

@@ -122,8 +122,8 @@ export const SearchPage = ({
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
if (e.key === 'Escape') {
e.preventDefault();
// Keep the trigger character ('@' or '/') in the editor when closing with Escape
closeSearch(trigger);
// Keep the trigger character and typed text in the editor when closing with Escape
closeSearch(`${trigger}${search}`);
} else if (e.key === 'Backspace' && search.length === 0) {
e.preventDefault();
closeSearch('');