cluk3 / cluk3/use-context-menu

holdToDisplay should be 1s by default only for touch events.

Open
#4 0 comments 1 reaction 1 assignee Claimed by @cluk3 View on GitHub
enhancement good first issue help wanted
Dominant language
JavaScript
Stars
36
Forks
3
PR merge metrics
No merged PRs in 30d

Description

I find the holdToDisplay feature useful only for touch, in desktop it's not very useful.

I would change the default option to be 1s for touch and 0 for mouse events.
The holdToDisplay option will have the following interface:

```
type HoldToDisplayConfig = {
({ touch: number } | { mouse: number })
}

interface ContextTriggerConfig{
holdToDisplay: number | HoldToDisplayConfig,
...otherOptions
}
```

With the default value being:

```
const defaultHoldToDisplay = {
mouse: 0,
touch: 1000
}
```

If a number is given it will apply to both touch and mouse.
Also, this will require a major version bump as it will be a breaking change.

I'll implement this myself during the next days, meanwhile if somebody shows up and wants to take care of this, I'll be more than happy.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.