How to use the @better-scroll/shared-utils.preventDefaultExceptionFn function in @better-scroll/shared-utils

To help you get started, we’ve selected a few @better-scroll/shared-utils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ustbhuangyi / better-scroll / packages / core / src / base / ActionsHandler.ts View on Github external
end: () => {
        return (
          preventDefault &&
          !preventDefaultExceptionFn(e.target, preventDefaultException)
        )
      },
      move: () => {
github ustbhuangyi / better-scroll / packages / core / src / scroller / Scroller.ts View on Github external
if (!cancelable.preventClick) {
      const _dblclick = this.options.dblclick
      let dblclickTrigged = false
      if (_dblclick && this.lastClickTime) {
        const { delay = 300 } = _dblclick as any
        if (getNow() - this.lastClickTime < delay) {
          dblclickTrigged = true
          dblclick(e)
        }
      }
      if (this.options.tap) {
        tap(e, this.options.tap)
      }
      if (
        this.options.click &&
        !preventDefaultExceptionFn(
          e.target,
          this.options.preventDefaultException
        )
      ) {
        click(e)
      }
      this.lastClickTime = dblclickTrigged ? null : getNow()
      return true
    }
    return false
  }
github ustbhuangyi / better-scroll / packages / mouse-wheel / src / index.ts View on Github external
private beforeHandler(e: CompatibleWheelEvent) {
    const {
      preventDefault,
      stopPropagation,
      preventDefaultException
    } = this.scroll.options
    if (
      preventDefault &&
      !preventDefaultExceptionFn(e.target, preventDefaultException)
    ) {
      e.preventDefault()
    }
    if (stopPropagation) {
      e.stopPropagation()
    }
  }
  private wheelMove(delta: { x: number; y: number }) {
github ustbhuangyi / better-scroll / packages / core / src / scroller / Actions.ts View on Github external
private handleClick(e: TouchEvent) {
    if (
      !preventDefaultExceptionFn(e.target, this.options.preventDefaultException)
    ) {
      e.preventDefault()
      e.stopPropagation()
    }
  }