-
-
Notifications
You must be signed in to change notification settings - Fork 590
Arrow keys trapped by block menu after typing / #259
Comments
It's not related to the I don't disagree though, when left + right remove the selection I would have thought up+down would be the same. |
Give the attached PR a try. |
Cool, that fix worked for the AllSelection case, thanks :) I was still playing around with the block menu and the up/down arrows though, and there's maybe? still some undesired behavior regardless of the select all behavior ... Once the block menu opens on an empty block using the Another thing is if I type out a string resulting in no results matching in the menu and press enter, closing the menu, or if I just close the menu with the esc key, I expect to be able to interact as normal with the lines, moving with the up/down arrow keys, and inserting new lines with the enter key, but the editor is preventing this from happening. Zipped a screen recording that demonstrates - after typing "/has", I can't move off the line using up/down arrow or enter key presses. I was trying to see whether it's possible to check whether the blockmenu is open to here - https://github.com/outline/rich-markdown-editor/blob/develop/src/plugins/BlockMenuTrigger.ts#L14, but I'm not sure what the best way to share state through the Extension interface. |
I think this is due to the BlockMenuTrigger plugin's handleKeyDown prop. The AllSelection results in a
from
position of0
and aparentOffset
of0
, which means thetextBetween
call within therun
function with argumentsfrom=0, to=0
returns an empty string which is matched by the regex. I don't have a suggestion atm for fixing, but hopefully a minor change should be fine.To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd assume that this should cancel out of the selection.
The text was updated successfully, but these errors were encountered: