Skip to content

fix(vue): preserve native Once cancellation before core handlers - #171

Merged
elonehoo merged 3 commits into
mainfrom
fix/vue-once-prevent-order
Nov 6, 2026
Merged

elonehoo merged 3 commits into
mainfrom
fix/vue-once-prevent-order

Conversation

@elonehoo

@elonehoo elonehoo commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Compose native Once consumer listeners before Steps/Select core handlers so .once.prevent can veto the first event without suppressing later core events.
  • Preserve custom component emit/callback semantics. Provide the unreleased useNativeEventProps adapter and a tested SFC example for explicitly cooperating DOM-forwarding wrappers.
  • Cover listener replacement/removal, receiver lifecycle, errors, stopImmediatePropagation, nested asChild and Fragment forwarding, and SSR/hydration behavior.

Validation

  • Local Vue unit tests: 706 passed (34 files).
  • Local SSR tests: 170 passed (20 files).
  • Vue typecheck, build, changed TypeScript lint, and diff checks passed; built JS and DTS export verified.
  • Four new trusted-input browser cases cover native/adapted click and keydown with dynamically added Once listeners. Local browser execution was unavailable; this draft requests the existing CI browser run. No claim of browser success yet.

Scope

Arbitrary custom components are not automatically treated as DOM receivers. The explicit adapter example documents native Once lifetime and limitations. No release or merge requested.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Rewrites Vue listener merging and ordering for Once vs core across factory, Dynamic, and Steps/Select; behavior change is security-adjacent (event handling) but heavily test-covered.

Overview
Release and docs: Bumps root and all public packages to 0.0.4, adds 0.0.4 release notes and vue-once-listeners.md, updates release-scope and changelogithub.config.mjs for the new fix-section copy, and points scripts/test-release-notes.mjs at 0.0.3→0.0.4 expectations.

Vue behavior: Introduces useCoreListenerProps (shared by Steps/Select trigger composables) plus core-listeners utilities that reorder native Once listeners before core handlers where core is composed, track known core functions, and thread __uiComposeOnce through Dynamic and the asChild factory so merged props stay correct.

Public API: Exports useNativeEventProps for custom DOM-forwarding components to bind attrs at the real native element.

Tests: Large additions and updates for Steps/Select listener contracts, once boundaries, SSR/hydration, and browser trusted click/keydown cases.

Risk: Medium — core change to how Vue merges and runs event listeners for Steps/Select and asChild; mitigated by broad new tests but worth careful review for edge cases.

Reviewed by Cursor Bugbot for commit 167f224. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
destyler-ui Ready Ready Preview Nov 6, 2026 9:31am UTC
destyler-ui-dev Ready Ready Preview Nov 6, 2026 9:31am UTC

@elonehoo
elonehoo marked this pull request as ready for review November 6, 2026 09:44
@elonehoo
elonehoo merged commit 77c0653 into main Nov 6, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant