Topic: Firefox on click event twice in input button within accordion

Karg priority asked 10 months ago


https://mdbootstrap.com/snippets/standard/karg/5395625

Placing an within an accordion (invisible) causes in Firefox on click event twice for one click.

Expected behavior

Accordion Item #2 contains 2 buttons, one "input" and one "a". Both have a "click" event handler added which logs to console. When clicking on each of these, event should only come once per click.

Actual behavior

Test1 ("input") logs twice for one click in Firefox (but not Chrome), Test2 ("a") logs only once for both Firefox and Chrome.

Resources (screenshots, code snippets etc.)

https://mdbootstrap.com/snippets/standard/karg/5395625


Kamila Pieńkowska staff answered 10 months ago


input will work weirdly on Firefox due to Firefox unique engine interaction with adding a ripple effect.

So I suggest using a or button tags if you want predictable behavior.


Kamila Pieńkowska staff answered 10 months ago


Please publish your snippet. Right now I don't have access to its content.


Karg priority commented 10 months ago

Sorry, now published.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 6.4.0
  • Device: Desktop
  • Browser: Firefox
  • OS: Windows 11
  • Provided sample code: No
  • Provided link: Yes