search: Fix backspace item deletion bug
Created by: fkling
Fixes #32352 (closed)
This was caused by the fact that I switched from listing to key up events to key down events, but didn't make the same change to the event handler bound to the textarea, so all key events bubbled up to the parent.
Instead of relying on stopping the event propagation, the list event handler now checks whether an annotation textarea is focused and if yes it ignores the event.
This commit also adds the ability to remove focus from the annotation textarea by pressing Escape.
Test plan
With enabled search stack feature:
- Navigate to any search, open/expand the notepad widget and add the current search. If the current search is not automatically selected, select it.
- Open the selected item's annotation input (if not already open) and enter any text.
- Press backspace or delete to delete text. The selected item does not get deleted.
- Press Escape, the textarea looses focus