Previously, I was on v0.124.0 and I just updated to v0.139.0. I had logic along the lines of:
editorView.preempt(
'core:move-up',
autocomplete.selectPreviousCompletion_.bind(autocomplete))
And in my callback handler:
selectPreviousCompletion_(e: Event):bool {
this.component.selectPreviousCompletion();
return false;
}
Previously, this was sufficient to let my UI handle the down arrow keypress and would prevent it from being handled by the editor due to the combination of preempt()
and return false
.
Are there any known changes in this area? Could this be any sort of race condition due to the order in which packages are loaded? Stepping through the jQuery event handling code is pretty gross, so I’m having a tough time debugging this.
The only clue that I have found so far is that I seem to have found myself inside handleCommandEvent()
in command-registry.js
with the listeners
array of size 2. The first element is an InlineListener
while the second is a SelectorBasedListener
. I believe that I am the first one in the list (good), but immediatePropagationStopped
has not been set (bad). This is even true after I added e.stopImmediatePropagation()
in my handler.