node-red / node-red

Low-code programming for event-driven applications
http://nodered.org
Apache License 2.0
19.89k stars 3.42k forks source link

SettingJS editor theme menu options disabled, but still key board shortcuts functional #2040

Open kpbhat86 opened 5 years ago

kpbhat86 commented 5 years ago

In node-red, via setting.js file, i disabled menu item "menu-item-edit-palette" for my dashboard. But Ctrl+Shift+P key board short cut which can be used to open Palette is functional. How to disable it?

editorTheme: {

                    menu: {
                        /** Hide unwanted menu items by id. see editor/js/main.js:loadEditor for complete list */
                        "menu-item-keyboard-shortcuts": false,
                        "menu-item-edit-palette": false
                    }
                }

Expected: When I disable menu item, related key board short cut also should not work.

Actual: Key board short cuts working even though menu items disabled via setting

Stacks: node-red: 0.19.5 OS: windows nodeJS: 8.11.1

knolleary commented 5 years ago

Hi - thanks for raising this. There is a disjoint here we need to find a way to fix - maybe a further option to disable built-in actions by name.

For this specific case, you can disable the 'Manage Palette' feature by setting:

editableTheme: {
   palette: {
      editable: false
   }
}

That will remove it from the Settings dialog, the menu option and the keyboard shortcut.

kpbhat86 commented 5 years ago

Thank you. This was very helpful...