Skip to content

bug(vue): hover-only and focus-only event configurations are dropped #375

Description

@vamgan

Summary

Vue's normalizeEvents() drops valid hover-only and focus-only configurations.

Root cause

packages/vue/src/useAskable.ts compares configured.indexOf(event) with the event's index in DEFAULT_EVENTS. For ['hover'] or ['focus'], the configured index is 0 while the default indexes are 1 and 2, so normalization returns an empty event list.

Proposed fix

Match the safe React/Solid implementation:

const configured = events ?? DEFAULT_EVENTS;
return DEFAULT_EVENTS.filter((event) => configured.includes(event));

Acceptance criteria

  • events: ['hover'] responds to hover
  • events: ['focus'] responds to focus
  • Reordered and duplicated arrays normalize deterministically
  • Existing click/default behavior remains unchanged
  • Tests dispatch actual hover and focus events, not only mount consumers

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: vueVue adapter workbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions