focusin/focusout events does not work in firefox #2524

Open
moldcraft opened this Issue Aug 26, 2013 · 4 comments

Projects

None yet

4 participants

@moldcraft
moldcraft commented Aug 26, 2013 edited

Firefox version 23.0, Ubuntu 12.04

In IE7, IE8 and Chrome 28 works fine

Especially I need that functionality for selects

At the moment I did a temporary "hack":

var $select = $('select-id');

var events = {
    focusin: function(){
        if ($select.getAttribute('data-focus') == 'in') {
            return;
        } else {
            $select.setAttribute('data-focus', 'in');
        }

        // ...
    },
    focusout: function(){
        if ($select.getAttribute('data-focus') == 'out') {
            return;
        } else {
            $select.setAttribute('data-focus', 'out');
        }

        // ...
    }
};

events.focus = events.focusin;
events.blur  = events.focusout;

$select.addEvents(events);

I can't use focus and blur because I change select's options dynamically on focusin and in IE this does not work properly with focus: It closes back select when clicked to open, and need to click again (without loosing focus) to open.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/847603-focusin-focusout-events-does-not-work-in-firefox?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F22067&utm_medium=issues&utm_source=github).
@ibolmo
Member
ibolmo commented Mar 3, 2014

Thank you for your fix, but could you provide a jsfiddle showing that the focus does not work.

@ibolmo ibolmo added this to the 1.5.1 milestone Mar 3, 2014
@SergioCrisostomo
Member

I confirm FF is broken on this: http://jsfiddle.net/he5UU/

@arian
Member
arian commented Mar 24, 2014
@ibolmo
Member
ibolmo commented Jul 3, 2014

Apparently there's this workaround: https://gist.github.com/nuxodin/9250e56a3ce6c0446efa

@SergioCrisostomo SergioCrisostomo modified the milestone: 1.5.2, 1.5.1 Jul 6, 2014
@SergioCrisostomo SergioCrisostomo modified the milestone: 1.5.2, 1.5.3 Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment