This one is IE specific (not anymore, apparently). We have very simple code:
Text
The way Ben McCormick mentioned works good for me on the major browsers (tested with Internet Explorer 11, Firefox and Chrome). For my solution you need to have an criteria to determine the parent with the draggable attribute (in my case I use a class name for that).
function fixSelectable(oElement, bGotFocus)
{
var oParent = oElement.parentNode;
while(oParent !== null && !/\bdraggable\b/.test(oParent.className))
oParent = oParent.parentNode;
if(oParent !== null)
oParent.draggable = !bGotFocus;
}
Text