Swap order of shortcut map merging so that customShortcuts are added first and override existing duplicate trigger shortcuts by absorbing the input first

pull/2089/head
ryanscott0515 9 months ago
parent 8589b856e8
commit 8829f4df8e
  1. 15
      lib/src/editor/raw_editor/raw_editor_state.dart

@ -533,7 +533,12 @@ class QuillRawEditorState extends EditorState
child: QuillStyles(
data: _styles!,
child: Shortcuts(
shortcuts: mergeMaps<ShortcutActivator, Intent>({
/// Merge with widget.configurations.customShortcuts
/// first to allow user's defined shortcuts to take
/// priority when activation triggers are the same
shortcuts: mergeMaps<ShortcutActivator, Intent>(
{...?widget.configurations.customShortcuts},
{
// shortcuts added for Desktop platforms.
const SingleActivator(
LogicalKeyboardKey.escape,
@ -710,10 +715,10 @@ class QuillRawEditorState extends EditorState
control: !isDesktopMacOS,
meta: isDesktopMacOS,
): const ScrollIntent(
direction: AxisDirection.down, type: ScrollIncrementType.page),
}, {
...?widget.configurations.customShortcuts
}),
direction: AxisDirection.down,
type: ScrollIncrementType.page),
},
),
child: Actions(
actions: mergeMaps<Type, Action<Intent>>(_actions, {
...?widget.configurations.customActions,

Loading…
Cancel
Save