mardi 4 août 2015

Why is my input tag losing focus immediately after getting it?

By the design, menu container onblur event should be disabled when input gets focus and it should be enabled back when input loses focus (i.e. when user finishes input.

function pauseHiding(hiderId) {
    var hider = document.getElementById(hiderId);
    hider.onblur = null;
}

function resumeHiding(hiderId, timeout) {
    var hider = document.getElementById(hiderId);
    hider.onblur = "setTimeout(function(){hideMenu(hiderId);}, timeout);";
    hider.focus();
}

In fact, input's onfocus event fires normally, but it is followed immediately by onblur event. Moreover, onfocus erases menu container's onblur event, but input's onblur doesn't returns it back. http://ift.tt/1ONfleU



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire