Beforeinput not being triggered on delete events at start and end of lines

I have an beforeinput event handler within handleDOMEvents. Usually the handler is triggered fine, however I noticed that it doesn’t trigger in the following cases:

  1. selection is at start of line and the backspace key is pressed
  2. selection is at end of line and del key is pressed (deleteContentForward event)

I notice that these events are being triggered from within regular contenteditable divs. Is there a way to get these to trigger?

Keys handled by keymaps won’t have their native behavior fire, and thus won’t fire beforeinput or input events. You’ll probably have to accept that, since you really don’t want browsers’ native behavior for block-related editing actions (it’s an inconsistent mess).

1 Like