Problem
Shared interactive components still rely on browser-specific focus, selectors, measurements, and overlay behavior. Successfully translating their markup does not establish native interaction parity.
Audited at v0.2.546, commit 0013ce66e3.
Source evidence
- Dialog uses closest(), refs, and the browser overlay stack for dismissal/focus behavior.
- TabList uses value selectors, closest(), focus(), and MutationObserver.
- Tooltip uses getBoundingClientRect(), offsetParent, viewport dimensions, and hover events.
- Native binding nodes expose only a limited DOM-shaped interface; their selector implementation does not support the TabList selector contract.
- Native compilation of shared Tooltip reports unread mouseenter/mouseleave events and positioning/style diagnostics.
- Shared Dialog currently fails earlier at MutationObserver during setup (tracked separately).
Requested change
Introduce reusable host-backed operations for focus, measurement, overlay presentation/dismissal, and component coordination. Adapt the shared components rather than creating independently maintained native copies. Define appropriate touch interactions for tooltip/popover behavior.
Coordinate actual platform operations with Craft where required; STX should own shared component behavior and the host contract.
Acceptance
- Dialog/Drawer open, close, and nested-dismissal behavior work on both targets.
- Focus handling is appropriate to each platform.
- Tabs select panels and maintain state when items change.
- Tooltip/popover positioning and touch behavior have an explicit supported contract.
- Unsupported host capabilities produce actionable feedback.
- Same-source interaction tests plus maintained Craft-host validation cover the implemented behavior.
Priority and scope
Fourth in the portability audit sequence, after portable props/events. This is a source-supported gap assessment, not a claim that every listed interaction was reproduced failing on a device. Split into focused implementation batches as needed.
Related audit issues
- fix(native): make shared component reactive props and emitted events host-independent: https://github.com/stacksjs/stx/issues/2086
- fix(native): preserve interactive label children and translate input types correctly: https://github.com/stacksjs/stx/issues/2087
- feat(native): make shared Form submission, values, and validation portable: https://github.com/stacksjs/stx/issues/2088