mdn / mdn/browser-compat-data

api.Element.pointerdown_event - Pointer events are not working on mobile browsers after window resize on scroll

Open
#18,000 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

browser:multiple data:api info needed
Dominant language
JSON
Stars
5.8k
Forks
2.6k
Avg merge
1d 21h
Merged PRs (30d)
186

Description

What type of issue is this?

Browser bug (a bug with a feature that may impact site compatibility)

What information was incorrect, unhelpful, or incomplete?

After scrolling events in mobile browsers (Chrome, Firefox, Safari), when the browser's navigation bar
resizes the window, pointer events on certain elements fail to occur until the window is manually resized or another event occurs.

The issue I had was fixed by reverting my 'onpointerdown' event back to a 'onmousedown' event.

What browsers does this problem apply to, if applicable?

Chromium (Chrome, Edge 79+, Opera, Samsung Internet), Firefox, Safari

What did you expect to see?

This issue was occurring only on mobile browsers. I was expecting the pointer events to work, regardless of any window resizing. There are no compatibility issues listed on the MDN page.

Did you test this? If so, how?

I attempted to reformat the sizing of my element (it was a mobile navigation icon at the top right of the screen), through scroll and resizing event listeners, but to no avail.

I also tried using different types of pointer events (down vs up). The solution came when I changed the event listener I was using from a 'pointerdown' event to a 'mousedown' event.

All of my tests were done by making changes to a published site on github and testing on an iphone 12 pro.

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

The site I was testing on is here, and the repository is here. Make sure to test in true mobile environment.

The code changed went from:
hamburger.onpointerdown = (event) => { event.preventDefault(); burgerSpin(); }
to:
hamburger.onmousedown = (event) => { event.preventDefault(); burgerSpin(); }

Do you have anything more you want to share?

I'm a still a new developer, so I can't discount that there was some other flaw, but I'm confident that there isn't.

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Element/pointerdown_event

MDN metadata
MDN page report details
  • Query: api.Element.pointerdown_event
  • Report started: 2022-10-14T23:55:51.947Z

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MDN pointerdown_event page and the linked navigation-bar repository/site. Reproduce the report on mobile Chrome, Firefox, and Safari after scrolling and browser navigation-bar resizing, comparing pointerdown with mousedown. Done means determining whether the behavior is a browser compatibility issue and whether the MDN compatibility data needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.