score:0
you can check that the event's detail
property is 1
, meaning it's not the second click of a double click.
if (e.detail !== 1) { return }
or use something like lodash
's throttle
handle_click = _.throttle(func, 500)
which will ensure the function can be called a most one time per 500ms
score:0
since, you are already recording number of clicks. how about you disable the button when the modal is opened and enable it once the modal is closed?
return <button
type='button'
classname={
this.state.ismodalactive ? 'disable' : ''
}
onclick={ this.handleclick }
>
make sure you update the state ismodalactive on each interaction with the button.
Source: stackoverflow.com
Related Query
- How to disable the second click on a button
- How to disable a submit button in redux form for the second time after the form is submitted for the first time?
- How to disable the hover effect of material-ui button inside of a styled component
- How to conditionally disable the submit button with react-hook-form?
- How I can disable a button in React js for 5 seconds after click event
- How to disable the menu button option in DataGrid MUI?
- How to handle the navigation for the Button click in ReactJS?
- how update the value of useEffect() hook on button click
- Using onClick function on a styled-components button doesn't change state until the second click (added sandbox URL)
- How to make one table record editable on button click in React when the table record is mapped?
- ReactJs How to change an icon of a button on the click event?
- How to get the time in seconds after click on submit button using React Count Down Timer
- how to change background color when I click the button using react hooks
- How to change the state value using a click button
- How to disable <react-date-picker> component on a button click
- React Js how to jump whole pages to other pages when click on the navigation button
- How do you shuffle a table of images every second on the click of a button?
- How do you get a button in DIV not call the <div> click event
- How do I control the state of this child component upon a button click in its parent?
- How to scroll to the particular div on button click in a single page application using react-router?
- How to disable button depending on the length of input value
- Using React, click the first input show the second input, how to auto focus to the second input?
- How to disable the login button when an api request is already in progress in React?
- How to set focus on child component's input on a button click in the parent in React Hooks
- How to blur the background after click on the button in react js
- Button in ReactJS calls the function only after the second click, no effect after the first click
- How to disable click event while fetching the data in reactjs witout jquery?
- How to not show tooltip when click the button immediately?
- Using Redux Form, how can I disable the submit button if no fields have been filled out?
- How can I disable the button at the end of this component?
More Query from same tag
- Using react hooks
- Importing Public Folder Images In Src Css Files In Reactjs
- How to render script tag inside JSX without manually create it
- Redux.js: catching malformed actions?
- How to make accordion first tab open by default React JS
- React google map wont update styles after changing theme (component re-render)?
- useState variables are null in event callback
- HTTPS Redirect in next js
- How to make my redux action will permanently save even I refresh my browser?
- ReactJS image uploading is not working
- How to minimize the if statement in javascript
- react_table__WEBPACK_IMPORTED_MODULE_2___default(...) is not a function
- Creating a todos list using react-infinite-scroller
- reactjs dynamic import with constant path variable
- How to highlight a specific table cell in material UI table in react based on a text search
- why add ref to child ref can only get a component instance rather than a DOM node?
- Getting data from a JSON array and setting states based on the data using loop in React
- Redirect with useNavigate and state seems to be hard to accomplish
- ReactJs change time video html5
- How to show a message and delete it each time the route changes
- Timer goes crazy when using setInterval inside useEffect
- React multiple checkbox with selected values set
- How to fix problem with arguments in function?
- Multitouch Gestures with useGesture in React
- How to hide sign out button on Amplify auth default configuration?
- react.js buttons that display different items from array
- Login form cannot get data from back-end in React
- How to map through nested values from API
- Fetch request to Cloudinary API from with React Component fails
- How to access data passed from dyamic route from express.js to react.js