Skip to content

fix(qwik): honor stopPropagation() from a deferred event handler - #8752

Merged
wmertens merged 1 commit into
build/v2from
qwikloader-deferred-stoppropagation
Jun 20, 2026
Merged

fix(qwik): honor stopPropagation() from a deferred event handler#8752
wmertens merged 1 commit into
build/v2from
qwikloader-deferred-stoppropagation

Conversation

@maiieul

@maiieul maiieul commented Jun 20, 2026

Copy link
Copy Markdown
Member

What is it?

  • Bug

Description

Split out of #8745 (it is unrelated to ErrorBoundary).

qwikloader walks the event path synchronously and collects one task list per element, then flushes them. A handler whose QRL is still importing can only call stopPropagation() after that walk has already moved on, so ancestor handlers on the bubbling path ran anyway. runEventTasks now re-checks cancelBubble between per-element task groups, so a deferred stop still skips later elements; a synchronous stop truncates the walk as before. Covered by new qwikloader.behavior.unit.ts cases (bubble + capture phase); the brotli budget bump reflects the added logic.

# What is it?
- Bug

# Description
qwikloader walks the event path synchronously and collects one task list per element, then flushes them. A handler whose QRL is still importing can only call stopPropagation() after that walk moved on, so ancestor handlers on the bubbling path ran anyway. runEventTasks now re-checks cancelBubble between per-element task groups, so a deferred stop still skips later elements; a synchronous stop truncates the walk as before.
@maiieul
maiieul requested a review from a team as a code owner June 20, 2026 06:53
@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 3d90cf7

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
@qwik.dev/router Patch
create-qwik Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@maiieul maiieul self-assigned this Jun 20, 2026
@maiieul maiieul moved this to Waiting For Review in Qwik Development Jun 20, 2026
maiieul added a commit that referenced this pull request Jun 20, 2026
The qwikloader runEventTasks/taskGroups change is unrelated to ErrorBoundary; extracted to #8752 so this PR is ErrorBoundary-only.
@pkg-pr-new

pkg-pr-new Bot commented Jun 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@qwik.dev/core

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@8752

@qwik.dev/router

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@8752

eslint-plugin-qwik

npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@8752

create-qwik

npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@8752

@qwik.dev/optimizer

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/optimizer@8752

commit: 3d90cf7

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor
built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 3d90cf7

@Varixo

Varixo commented Jun 20, 2026

Copy link
Copy Markdown
Member

I dont understand it, thats why we have stoppropagation:*, no?

@wmertens wmertens left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@wmertens
wmertens merged commit 51dba9f into build/v2 Jun 20, 2026
49 checks passed
@wmertens
wmertens deleted the qwikloader-deferred-stoppropagation branch June 20, 2026 09:18
@github-project-automation github-project-automation Bot moved this from Waiting For Review to Done in Qwik Development Jun 20, 2026
wmertens added a commit that referenced this pull request Jun 21, 2026
intellix pushed a commit to intellix/qwik that referenced this pull request Jun 25, 2026
`ev.stopPropagation()` and `ev.preventDefault()` are synchronous APIs and should not be used to steer async handling. Use shared state instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants