error de clic en el documento? (Firefox - ventanas)

Aquí está el problema Firefox (Windows) does not trigger document click event, when select is open. It just closes the select, and only next click will be counted as a click.

Reproducir:

  1. Click select (the drop-down menu will appear)
  2. Click outside the drop-down menu, on document outside (select will be closed)

However, the 2nd click won't trigger the document click event.

Como puedes ver en esto video de Youtube, there are 3 clicks but 2 events.

Demostración en jsFiddle

HTML

<select>
    <option value="1">Value1</option>
    <option value="2">Value2</option>
    <option value="3">Value3</option>
</select>
<div id="debug"></div>

JS

var n = 0;
$(document).ready(function(){
    $('select').click(function(e){
      e.stopPropagation();
      n++;
      $('#debug').text('select clicked ' + n);
    });

    $(document).click(function(){
        n++;        
        $('#debug').text('document clicked '+ n);
    });
})

preguntado el 12 de junio de 12 a las 22:06

what version of Firefox do you use? -

hm... i have 11... will try to update. but still it's strange -

nope... ff13 same problem for me. -

maybe it's a OS difference? mac/windows for example -

maybe, using win... added video -

0 Respuestas

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.