Skip to content

Hammer tap event doesn't fire after binding sanitized HTML on iOS #40781

@JaapMosselman

Description

@JaapMosselman

🐞 bug report

Affected Package

The issue is caused by package @angular/core and @angular/platform-browser I guess

Is this a regression?

Don't know

Description

Clickable elements (such as input and anchor tags) on a page seem unresponsive in browsers on iOS devices when all of the following three conditions are met:

  1. An html snippet with a link is inserted via the [innerHTML] property.
  2. That snippet bypasses the html sanitizing by using the bypassSecurityTrustHtml method.
  3. There is a HostListener listening to the 'tap' event (for which hammer.js is installed).

When you swipe or scroll the page a bit first, then you can click one element. But after that you have to swipe or scroll again to click the next element.

🔬 Minimal Reproduction

https://angular-ivy-e3igjz.stackblitz.io

🌍 Your Environment

Angular Version:

11.1

Anything else relevant?

Browsers on iOS 14.x at least. Not tested on lower versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4A relatively minor issue that is not relevant to core functionsarea: coreIssues related to the framework runtime

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions