🐛(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) add fallback for unsupported Blocknote languages #1810
|
||||||
- 🐛(frontend) fix emojipicker closing in tree #1808
|
- 🐛(frontend) fix emojipicker closing in tree #1808
|
||||||
- 🐛(frontend) display children in favorite #1782
|
- 🐛(frontend) display children in favorite #1782
|
||||||
|
- 🐛(frontend) preserve typed text after @ on escape #1833
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
|
|||||||
@@ -122,8 +122,8 @@ export const SearchPage = ({
|
|||||||
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
const handleKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {
|
||||||
if (e.key === 'Escape') {
|
if (e.key === 'Escape') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// Keep the trigger character ('@' or '/') in the editor when closing with Escape
|
// Keep the trigger character and typed text in the editor when closing with Escape
|
||||||
closeSearch(trigger);
|
closeSearch(`${trigger}${search}`);
|
||||||
} else if (e.key === 'Backspace' && search.length === 0) {
|
} else if (e.key === 'Backspace' && search.length === 0) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
closeSearch('');
|
closeSearch('');
|
||||||
|
|||||||
Reference in New Issue
Block a user