Skip to content

bug: tapIgnoreEvent doesn't check for data-tap-disabled #2132

@emertechie

Description

@emertechie

Type: bug

Platform: mobile webview

For various reasons I had to use another scrolling library in one area of my app. To disable the Ionic scroll stuff, I used overflow-scroll="true" on the ion-content and also data-tap-disabled="true" on a container element. However the Ionic tap library was still interfering (causing events not to fire in the other library).

It boiled down to the tapIgnoreEvent method in tap.js:

function tapIgnoreEvent(e) {
  if(e.isTapHandled) return true;
  e.isTapHandled = true;

  if( ionic.scroll.isScrolling && ionic.tap.containsOrIsTextInput(e.target) ) {
    e.preventDefault();
    return true;
  }
}

It's not checking if the element, or a parent, has the "data-tap-disabled" attribute set.
It should be using the isElementTapDisabled method like other tap handlers. Changing first line to the following fixes issues:

function tapIgnoreEvent(e) {
  if(e.isTapHandled || ionic.tap.isElementTapDisabled(e.target)) return true;
  ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions