Skip to content

bug: focus visible needs passive touchstart listener #27566

Closed

Description

@aparajita

Prerequisites

Ionic Framework Version

v7.x

Current Behavior

Whenever an ion-datetime is first rendered, I get the following warning in the console (Brave Version 1.51.118 Chromium: 113.0.5672.126 (Official Build)):

[Violation] Added non-passive event listener to a scroll-blocking 'touchstart' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
startFocusVisible @ focus-visible.js:60
connectedCallback @ ion-datetime.js:884
connectedCallback @ index.js:2580
insert @ runtime-dom.esm-bundler.js:10
mountElement @ runtime-core.esm-bundler.js:5246
processElement @ runtime-core.esm-bundler.js:5156
patch @ runtime-core.esm-bundler.js:5028
patchKeyedChildren @ runtime-core.esm-bundler.js:6098
patchChildren @ runtime-core.esm-bundler.js:5879
patchElement @ runtime-core.esm-bundler.js:5332
processElement @ runtime-core.esm-bundler.js:5167
patch @ runtime-core.esm-bundler.js:5028
componentUpdateFn @ runtime-core.esm-bundler.js:5773
run @ reactivity.esm-bundler.js:178
instance.update @ runtime-core.esm-bundler.js:5814
callWithErrorHandling @ runtime-core.esm-bundler.js:158
flushJobs @ runtime-core.esm-bundler.js:357

Expected Behavior

There should be no warning.

Steps to Reproduce

  1. Open the reproduction.
  2. Right-click on the datetime and select "Inspect". View the console.
  3. Click the refresh arrow next to the address bar of the web container.

You should see the warning.

Code Reproduction URL

https://stackblitz.com/edit/5jxbrs

Ionic Info

Ionic:

Ionic CLI : 7.1.1 (/Users/aparajita/Developer/projects/clients/willsub/apps-monorepo/node_modules/.pnpm/@Ionic[email protected]/node_modules/@ionic/cli)

Capacitor:

Capacitor CLI : 4.8.0
@capacitor/android : 4.8.0 (/Users/aparajita/Developer/projects/clients/willsub/apps-monorepo/node_modules/.pnpm/@capacitor+android@4.8.0_@capacitor[email protected]/node_modules/@capacitor/android)
@capacitor/core : 4.8.0 (/Users/aparajita/Developer/projects/clients/willsub/apps-monorepo/node_modules/.pnpm/@capacitor[email protected]/node_modules/@capacitor/core)
@capacitor/ios : 4.8.0 (/Users/aparajita/Developer/projects/clients/willsub/apps-monorepo/node_modules/.pnpm/@capacitor+ios@4.8.0_@capacitor[email protected]/node_modules/@capacitor/ios)

Utility:

cordova-res : not installed globally
native-run : not installed globally

System:

NodeJS : v20.0.0 (/Users/aparajita/Library/pnpm/nodejs/20.0.0/bin/node)
npm : 9.6.4
OS : macOS Unknown

Additional Information

This is a regression. I originally reported this in v6 and it was fixed. It has reappeared with v7.0.9.

Activity

  1. self-assigned this
    on May 30, 2023
  2. liamdebeasi commented on May 30, 2023

    @liamdebeasi
    Contributor

    Thanks for the report. It looks like we need to make

    ref.addEventListener('touchstart', pointerDown);
    passive. Note that the v6 bug report was for a different module, so this is not a regression.

  3. changed the title [-]bug: Adding non-passive event listener to a scroll-blocking 'touchstart' event[/-] [+]bug: focus visible needs passive touchstart listener[/+] on May 30, 2023
  4. added
    package: core
    type: bug
    on May 30, 2023
  5. removed their assignment
    on May 30, 2023
  6. added a commit that references this issue on May 30, 2023
    e54bf14
  7. ionitron-bot commented on Jun 29, 2023

    @ionitron-bot

    Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

  8. locked and limited conversation to collaborators on Jun 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    package: coretype: bug

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions