Open cianfoley-nearform opened 5 years ago
Worth thinking about how useful some of these would be or prioritising what would be useful. Many of the scenarios could be covered by the current set of synthetic events on offer. Creating a pass through function would over complicate things: https://reactjs.org/docs/events.html#supported-events
Sure, i think there's issue between determining single vs double click, again browserwide, the click outside should be a common enough use case too
There is an onDoubleClick
in the docs.
Yeah. The off click could be a great one to implement. It's a tricky one I've written about before 👍
Yeah I know about doubleclick but AFAIK the single click is also set off by doubleclick (could be wrong here), we had a situation before where if doubleclick is clicked we don't want single click being triggered, it might be a usecase e.g. if doubleclick doesn't happen within X, raise singleclick events sort of thing and maybe apply to offclick if that was nailed too...
Nope that's completely correct 👍
The way I've tackled this previously is to store setInterval
invocations in an Array
in state
and if doubleClick
is fired, clear the intervals.
There's a rough example in this code: https://codepen.io/jh3y/pen/aPzVme
Could be a good gotcha one to implement a hook for 👍
Investigate and integrate Mouse Events and some handy features e.g.
position already done, but should be part of mouse suite that can work together:
e.g. click outside double clicks vs single (timer based maybe configurable) right click pass in element or default to page (resize will need rework for this) hover, again could be page vs element
all of these could be individual hooks, possibly could be justified to be in it's own lib