You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe a bug.
So I created an inline tool and gave it a getter function 'shortcut' that returns a key combination string.
export default class TextConverter {
static get isInline() {
return true;
}
get shortcut() {
return 'CMD+D';
}
/** render, surround and checkState function... */
}
But the shortcut is not registered.
src/components/modules/toolbar/inline.ts:578 has this piece of code
if (internalTools.includes(toolName)) {
shortcut = this.inlineTools[toolName][Tools.INTERNAL_SETTINGS.SHORTCUT];
} else if (toolSettings && toolSettings[Tools.USER_SETTINGS.SHORTCUT]) {
shortcut = toolSettings[Tools.USER_SETTINGS.SHORTCUT];
}
if (shortcut) {
this.enableShortcuts(tool, shortcut);
}
toolSettings has my external inline tool in it but not directly under toolSettings
toolSettings looks like this { class: { sanitize, ... } }
So the check 'toolSettings && toolSettings[Tools.USER_SETTINGS.SHORTCUT]' would fail.
What am I doing wrong here?
Steps to reproduce:
Just create an external inline-tool and give it a shortcut key
Describe a bug.
So I created an inline tool and gave it a getter function 'shortcut' that returns a key combination string.
But the shortcut is not registered.
src/components/modules/toolbar/inline.ts:578 has this piece of code
toolSettings has my external inline tool in it but not directly under toolSettings
toolSettings looks like this
{ class: { sanitize, ... } }
So the check 'toolSettings && toolSettings[Tools.USER_SETTINGS.SHORTCUT]' would fail.
What am I doing wrong here?
Steps to reproduce:
Just create an external inline-tool and give it a shortcut key
Expected behavior:
Shortcut should be registered
Screenshots:
none
Device, Browser, OS:
Macbook, Chrome(Electron), MacOS
Editor.js version: 2.17.0
The text was updated successfully, but these errors were encountered: