🐛(frontend) preserve typed text after @ on escape
prevents losing input when closing interlink search
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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('');
|
||||
|
||||
Reference in New Issue
Block a user