I have the problem that I have a widget that surrounds the cm6 editor and it handles the Escape key.
I want to change the handling within the search addon so that the event doesn’t bubble up the DOM if I press the Escape key while focus is within the search panel’s input fields
The recommended approach is to check for event.defaultPrevented in your outer handlers, and ignore events that have already been prevented. If that’s not practical, add a (low precedence) keydown handler to your editor that calls stopPropagation on all events that have their default behavior prevented.
I found another way to solve the problem for my case
Now I would still need the X Button on the search panel delete a state, so basically I’d need to change its behavior a bit. Is there an easy way?