Skip to content
This repository has been archived by the owner on May 5, 2021. It is now read-only.

Shortcut LVL can discart lower level too brutally #451

Open
Goaman opened this issue Oct 20, 2020 · 1 comment
Open

Shortcut LVL can discart lower level too brutally #451

Goaman opened this issue Oct 20, 2020 · 1 comment
Labels
discussion Extra discussion is needed

Comments

@Goaman
Copy link
Contributor

Goaman commented Oct 20, 2020

If you have a shortcut that match with the keymap in a specific LVL (e.g. USER (LVL1)), it stop rerturning the match for a previous LVL (e.g. DEFAULT (LVL0)).

Because of the following logic in Keymap.ts:

if (matchingCommands.length) {
    // Matches were found at this level so do not look lower.
    break;
}

This mechanism was put in place for being able to override a shortcut in a LVL higher previous lvl that could match with the shortcut.

However, if we create a selector that match anything in the user LVL2:

A user defining a shortcut:

{
  pattern: 'TAB',
  selector: [() => true],
  commandId: 'openLinkDialog',
}

Any shortuct TAB in user space will be discarted.

Thus making the tab shortcut for list not working.

We need to rethink to not discart the all the shortcut of a lower level.

@Goaman Goaman added the discussion Extra discussion is needed label Oct 20, 2020
@Gorash
Copy link
Contributor

Gorash commented Oct 20, 2020

eg:

If create a shortcut custom Delete USER level who match with the DIV container, the Delete in list item of UL to outdent does not work anymore.

<div>abc<div>
<ul>
 <li class="li_1">
   <ul><li></br></li></ul>
 </li>
</ul>
<div>
 <ul>
   <li class="li_2">
     <ul><li></br></li></ul>
   </li>
 </ul>
</div>

Delete in DIV trigger custom
Delete in LI.li_1 must trigger outdent (broken)
Delete in LI.li_2 must trigger custom

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discussion Extra discussion is needed
Projects
None yet
Development

No branches or pull requests

2 participants