maheshchari / js-hotkeys

Automatically exported from code.google.com/p/js-hotkeys
0 stars 0 forks source link

DisableInInput - disable keys in editable <div contenteditable="true"> #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Setup DisableInInput to true
2. Set cursor focus to an html editable div element
3. Press a configured keyboard shortcut

What is the expected output? What do you see instead?
I would hope that focus on editable div would disable keyboard shortcuts
if DisableInInput is true.  
Currently, the keyboard shortcut is executed.

Please provide any additional information below.

Is it possible to make a fix for this?
I understand that it could be done in this block:

if (jTarget.is("input") || jTarget.is("textarea") || jTarget.is("select") 
    || elem.is("input") || elem.is("textarea") || elem.is("select")) 
{
return true;
}

Just do not know how to reference editable div.

Original issue reported on code.google.com by marcis.z...@gmail.com on 13 Nov 2014 at 1:26

GoogleCodeExporter commented 8 years ago
Already fixed this:
need to add elem.attr("contenteditable") == "true" in disableInInput checking.

BR

Original comment by marcis.z...@gmail.com on 13 Nov 2014 at 1:51