Skip to content

Make eventListeners added by matTooltip passive to fix Lighthouse Error #17254

@naveedahmed1

Description

@naveedahmed1

Reproduction

This is based on the issue (angular/angular#32733) reported in Angular repository.

As per the Developers Docs

Add the passive flag to all of the event listeners that Lighthouse has identified. In general, add the passive flag to every wheel, mousewheel, touchstart, and touchmove event listener that does not call preventDefault().

Ref: https://developers.google.com/web/tools/lighthouse/audits/passive-event-listeners

But it seems that the event listeners added by matTooltip are not passive https://github.com/angular/components/blob/master/src/material/tooltip/tooltip.ts#L241

Therefore, LightHouse throws error Does not use passive listeners to improve scrolling performance

Expected Behavior

Material components should follow passive event listeners guidelines available in Developers Docs.

Actual Behavior

LightHouse throws error Does not use passive listeners to improve scrolling performance

Environment

  • Angular:9.0.0-next.8
  • CDK/Material:8.1.4

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