Topic: Button Component Registering Double Click onClick
Ben Hagan
free
asked 6 years ago
When clicking on a Button component with an onClick prop, the function fires twice, once on the downclick, and once on the click release.
Could this be related to https://mdbootstrap.com/support/floating-button-onclick-issue-with-firefox/?
Here's the code:
<Button
color="info"
onClick={() => {
this.props.toggleShowCleared();
}}
>
Show Cleared
</Button>
Jakub Strebeyko
staff
answered 6 years ago
this.props
passed function or a simple one being defined on the component)? Seeking clues.
With Best Regards,
Kuba
Ben Hagan
free
answered 6 years ago
Jakub Strebeyko
staff
answered 6 years ago
waves effect
and ended up requiring FireFox users to double click on buttons to have their callbacks run as expected. It has resolved in 4.6.1
and now pasting the button code into our App (or a create-react-app
-created app with MDB React attached, for that matter) has the button work with a callback (that I personally changed to console.log
) work as expected on my end, meaning one click = one firing of a function, on both Chrome and FF. What version of MDB React are you using?
With Best Regards,
Kuba
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- ForumUser: Free
- Premium support: No
- Technology: MDB React
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: Yes