naver / egjs-conveyer

Conveyer adds Drag gestures to your Native Scroll.
https://naver.github.io/egjs-conveyer/
MIT License
111 stars 8 forks source link

fix: fix incorrect isTrusted value in finishScroll event #41

Closed malangfox closed 1 year ago

malangfox commented 1 year ago

Details

This sets the isTrusted value in finishScroll event more accurately after fixing the bug in #34.

First, I removed the following logic from the change event. if (nativeEvent && !isHold) { return; } Removing this part will not change the behavior, as it was working correctly in the previous situation where isHold was being calculated as true.

And I fixed an issue where _isAnimation was being set incorrectly, affecting the isTrusted value of finishScroll event.

_isAnimation should be set to true when conveyer is not in a holding state and a change event is not fired by the user wheel, assuming that change event has occurred due to internal methods.