RichText.Config.Command.namedCommandListFromKeyboardEvent calls keyboardEventToDictKey internally which sorts the keys before converting the short key to __Short__ whereas the command mapping setup code converts first and then sorts. This causes redo to not work (at least on Mac) in the examples, e.g. in https://mweiss.github.io/elm-rte-toolkit/#/examples/markdown. I have a vendored fork that changes keyboardEventToDictKey to be
keyboardEventToDictKey : String -> KeyboardEvent -> List String
keyboardEventToDictKey shortKey keyboardEvent =
([ keyboardEvent.key ]
|> addShiftKey keyboardEvent
|> addMetaKey keyboardEvent
|> addCtrlKey keyboardEvent
|> addAltKey keyboardEvent
)
|> List.map
(\v ->
if v == shortKey then
short
else
v
)
|> List.sort
which fixes the problem. I'll try and make a PR later, but wanted to document it so I don't forget.
RichText.Config.Command.namedCommandListFromKeyboardEvent
callskeyboardEventToDictKey
internally which sorts the keys before converting the short key to__Short__
whereas the command mapping setup code converts first and then sorts. This causes redo to not work (at least on Mac) in the examples, e.g. in https://mweiss.github.io/elm-rte-toolkit/#/examples/markdown. I have a vendored fork that changeskeyboardEventToDictKey
to bewhich fixes the problem. I'll try and make a PR later, but wanted to document it so I don't forget.