I want to bind the Backspace key to implement custom deletion. For example, when deleting the widget ‘table_one.AAA’, it should be replaced with ‘table_one.’. I am using Decoration.widget
and atomicRanges
for this purpose.
But I found that the ‘Backspace’ key cannot be bound using keymap.of
or listened to using PluginSpec.eventHandlers
.
Is changeFilter suitable?
finish:
const deleteWidget = EditorState.changeFilter.of((tr: Transaction) => {
if (tr.isUserEvent('delete')) {
console.log('deleteWidget');
}
return true;
});
It absolutely can. Is it possible that your binding ends up with a lower precedence than the default keymap?
Yes, it’s my problem.thanks!