bootstrap-markdown icon indicating copy to clipboard operation
bootstrap-markdown copied to clipboard

Hotkeys still working on disabled buttons

Open sergiocerrutti opened this issue 9 years ago • 1 comments

Since I cannot rewrite default buttons without editing the core, I've disabled default link button and created a new one, but the problem is the hotkey is still triggering the disabled link button (and the new one too of course).

Also I cannot unbind any specific hotkey because events are not namespaced (for example: 'keydown.cmdUrl'), so the only way is to unbind all hotkeys and bind them again.

A quick hack is to remove that button from the DOM inside the onShow callback: $('[data-handler="bootstrap-markdown-cmdUrl"]', e.$editor).remove();

Thank you @toopay!

sergiocerrutti avatar Apr 28 '16 10:04 sergiocerrutti

I see the preview is also still working with Ctrl+p even if preview is disabled. You can test it in the Twitter footer editor you have in you demo page. Once you trigger the hotkey, you cannot even go back to the editor.

sergiocerrutti avatar Apr 28 '16 11:04 sergiocerrutti