Skip to content

test(playwright): scope drag selection clear to firefox - #31301

Merged
ShaneK merged 1 commit into
mainfrom
fix/tests
Jul 28, 2026
Merged

test(playwright): scope drag selection clear to firefox#31301
ShaneK merged 1 commit into
mainfrom
fix/tests

Conversation

@ShaneK

@ShaneK ShaneK commented Jul 28, 2026

Copy link
Copy Markdown
Member

Issue number: internal


What is the current behavior?

The shared dragElementBy Playwright helper (core/src/utils/test/playwright/drag-element.ts, used by every gesture e2e test) unconditionally runs await page.evaluate(() => window.getSelection()?.removeAllRanges()) between mouse.down() and the drag movement. That line was added in #31260 to clear a Firefox-only text selection, but the extra page.evaluate() is an awaited round-trip that injects variable latency into the gesture path for all browsers. On WebKit that latency messes up the gesture's timing-derived velocityX, so the item-sliding safe-area screenshot tests in md mode settle a few pixels off and flake randomly. Since it lives on main, the flake has propagated to every other branch (next and major-9.0) and causes random test failures in PRs and nightlies.

What is the new behavior?

The selection clear now only runs on Firefox, which is the only engine that needs it (the existing comment already scoped the problem to Firefox). Chromium and WebKit skip the extra round-trip and get the same drag timing they had before #31260, so the item settles deterministically and the flake goes away. This matches the browserType().name() === 'webkit' gate already used elsewhere in the same file.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Regression was introduced by #31260 (the removeAllRanges line, not the modal a11y change itself). Verified by running in docker locally several times.

@ShaneK
ShaneK requested a review from a team as a code owner July 28, 2026 14:11
@ShaneK
ShaneK requested a review from OS-jacobbell July 28, 2026 14:11
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Jul 28, 2026 2:15pm

Request Review

@github-actions github-actions Bot added the package: core @ionic/core package label Jul 28, 2026

@gnbm gnbm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ShaneK
ShaneK added this pull request to the merge queue Jul 28, 2026
Merged via the queue into main with commit d767224 Jul 28, 2026
52 checks passed
@ShaneK
ShaneK deleted the fix/tests branch July 28, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants