-2

There is a custom select box which Firefox cannot interact. Does anyone understand what is the problem ? I guess the problem is in the code below:

$(".custom-select-trigger").on("click", function() {
    $('html').one('click',function() {
        $(".custom-select").removeClass("opened");
    });
    $(this).parents(".custom-select").toggleClass("opened");
    event.stopPropagation();
});

The select box is here: https://codepen.io/yy/pen/vOYqYV

executable
  • 3,365
  • 6
  • 24
  • 52
  • 2
    Possible duplicate of https://stackoverflow.com/questions/20522887/referenceerror-event-is-not-defined-error-in-firefox – misorude Nov 20 '18 at 11:21

3 Answers3

0

If you check your console, it says event not defined.

Here $(".custom-select-trigger").on("click", function() { you need to add event, so it says $(".custom-select-trigger").on("click", function(event) {

elveti
  • 2,316
  • 4
  • 20
  • 27
0

ReferenceError: event is not defined error is showing in the firefox console. this means you are using event which is not defined. so rewrite the code as follows

$(".custom-select-trigger").on("click", function(event) {//added event here
  $('html').one('click',function() {
    $(".custom-select").removeClass("opened");
  });
  $(this).parents(".custom-select").toggleClass("opened");
  event.stopPropagation();
}); 

DEMO HERE

Kiranramchandran
  • 2,094
  • 16
  • 30
-1
$(".custom-select-trigger").click(function() {
  $(this).parent().toggleClass("opened");
});
Mohammad
  • 21,175
  • 15
  • 55
  • 84
AddWeb Solution Pvt Ltd
  • 21,025
  • 5
  • 26
  • 57