Skip to content

Commit

Permalink
refactor(keyboard-navigation): use xBus only
Browse files Browse the repository at this point in the history
  • Loading branch information
victorcg88 committed Jun 4, 2024
1 parent df925a2 commit 83b64a4
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import { ArrowKey, EventsForDirectionLimit, TakeNavigationControl } from '../utils/types';
import { XEventsOf } from '../wiring/events.types';
import { WireMetadata } from '../wiring/wiring.types';
import { use$x, useXBus } from '../composables';
import { useXBus } from '../composables';
/**
* Base component to handle keyboard navigation for elements inside it. It has a required slot to
Expand Down Expand Up @@ -56,8 +56,6 @@
},
setup: function (props) {
const el = ref<HTMLElement>();
const $x = use$x();
const xBus = useXBus();
/**
Expand Down Expand Up @@ -132,7 +130,7 @@
function emitDirectionalLimitReached(direction: ArrowKey): void {
const xEvent = props.eventsForDirectionLimit?.[direction];
if (xEvent) {
$x.emit(xEvent, undefined, { target: elementToFocus });
xBus.emit(xEvent, undefined, { target: elementToFocus });
}
}
Expand Down

0 comments on commit 83b64a4

Please sign in to comment.