fix(dioxus): synthesize auxclick + position-guard contextmenu in Actions#495
Conversation
Closes #494. Two DOM-event-completeness gaps in the embedded driver's W3C Actions handler: - Non-primary clicks now synthesize `auxclick` (the spec's non-primary counterpart to `click`): middle-button → `auxclick`, right-button → `auxclick` + `contextmenu`. Previously a middle click emitted no high-level event and right emitted only `contextmenu`. - `contextmenu` (and every activation) is now position-guarded: a button's press and release must land on the same spot, so a right-button drag no longer pops a contextmenu. Generalized the primary-only `primary_down_pos` tracking to a per-button `down_pos` map driving the same-position guard uniformly; `dblclick` stays primary-only. The event set per button lives in a pure `activation_events()` helper with unit coverage; added an `auxclick` builder assertion. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Standing release PR: #456 · 9 packages queued · open 158h 36m · ✅ ready to merge Release Preview — 12 packages
These changes will be added to the release PR (#456) when merged: Changelog@wdio/dioxus-bridge 1.0.0-next.3 → 1.0.1Changed
@wdio/dioxus-service 1.0.0-next.3 → 1.0.1Changed
wdio-dioxus-driver 1.0.0-next.3 → 1.0.1Changed
wdio-dioxus-embedded-driver 1.0.0-next.3 → 1.0.1Changed
Fixed
@wdio/tauri-service 1.2.0 → 1.2.1Changed
@wdio/flutter-service 1.0.0-next.1 → 1.0.1Changed
wdio_flutter N/A → 1.0.1Changed
@wdio/electron-service 10.1.0 → 10.1.1Changed
@wdio/native-core 1.0.0 → 1.0.1Changed
@wdio/native-mobile-core 1.0.0 → 1.0.1Changed
@wdio/native-spy 1.1.0 → 1.1.1Changed
@wdio/native-utils 2.4.0 → 2.4.1Changed
@wdio/react-native-service 1.0.0-next.0 → 1.0.1Changed
After merge — predicted release
Updated automatically by ReleaseKit |
|
| Filename | Overview |
|---|---|
| packages/dioxus-embedded-driver/src/server/handlers/actions.rs | Adds activation_events(button) helper and replaces primary_down_pos: Option<…> with down_pos: HashMap<u32, (i32, i32)> to synthesize auxclick/contextmenu per spec and position-guard context menus; logic is correct and well-tested. |
Reviews (2): Last reviewed commit: "docs(dioxus): correct down_pos comment t..." | Re-trigger Greptile
Greptile P2: the comment was carried over from the old primary-only `primary_down_pos` and mis-described the generalized per-button `down_pos`. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Closes #494 — the two DOM-event-completeness gaps deferred from #488's Actions handler. Both are in
packages/dioxus-embedded-driver/src/server/handlers/actions.rs.1.
auxclickfor non-primary clicksPer the UI Events spec, a same-spot press+release of a non-primary button fires
auxclick(the non-primary counterpart ofclick). Before this PR a middle-button click synthesized no high-level event and a right-button click fired onlycontextmenu. Now:click(+dblclickon the second) — unchangedauxclickauxclick+contextmenu2.
contextmenuposition guard (right-button drag)The primary path only fired
clickwhen press and release shared a position; the right button firedcontextmenuunconditionally, so a right-button drag (press A → move → release B) still popped a context menu. Now every activation is position-guarded.Implementation
Generalized the primary-only
primary_down_pos: Option<…>to a per-buttondown_pos: HashMap<u32, (i32, i32)>, so the same-position guard and the per-button event set apply uniformly across all buttons (andpointerCanceldrops the canceled source's entries). The event set lives in a pureactivation_events(button)helper;dblclickstays primary-only (it needs cross-gesture state).Tests
activation_events_per_button— primary→click, middle→auxclick, right→auxclick+contextmenu, other-non-primary→auxclick.auxclickbuilder assertion alongside the existing click/contextmenu/dblclick ones.cargo test --lib: 24 passed.cargo clippy --all-targets: clean.Out of scope
Native engine-only behaviors for trusted input (real OS context menu, native selection) — synthesized DOM events can't reproduce those, per #488's documented limitations.
🤖 Generated with Claude Code