naver / egjs-axes

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates.
https://naver.github.io/egjs-axes/
MIT License
179 stars 32 forks source link

feat: add preventClickOnDrag option to PanInput #199

Closed malangfox closed 2 years ago

malangfox commented 2 years ago

Details

This adds the option to cancel the click event when a valid drag occurs in PanInput and RotatePanInput.

We currently implemented this feature on Flicking that uses PanInput. However, there are cases when you want to use this preventClickOnDrag feature in other UIs that uses PanInput.

After we add preventClickOnDrag to PanInputOption, Flicking can exclude implementation about preventClickOnDrag and handle it by PanInputOption.

daybrush commented 2 years ago

There are a few things to check.

  1. Prevent the click event of the element's parent? vs Prevent click event on child inside vs element? vs prevent everything?
  2. What is the need for the preventClickOnDragStart option? Option to block clicks as soon as you start dragging.
  3. Check the process in which the click event occurs in touch.