Skip to content

Commit 2316910

Browse files
authored
[r94150776] feat: it emits a toggle-full event, when alt + clicking on the leaf-link (#389)
1 parent 1117529 commit 2316910

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/components/Navigator/NavigatorCardItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@
7676
:aria-describedby="`${ariaDescribedBy} ${usageLabel}`"
7777
class="leaf-link"
7878
ref="reference"
79-
@click.native="handleClick"
79+
@click.exact.native="handleClick"
80+
@click.alt.native.prevent="toggleEntireTree"
8081
>
8182
<HighlightMatches
8283
:text="item.title"

tests/unit/components/Navigator/NavigatorCardItem.spec.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,14 @@ describe('NavigatorCardItem', () => {
286286
expect(wrapper.emitted('navigate')).toEqual([[defaultProps.item.uid]]);
287287
});
288288

289+
it('emits a `toggle-full` event, when alt + clicking on the leaf-link', () => {
290+
const wrapper = createWrapper();
291+
wrapper.find('.leaf-link').trigger('click', {
292+
altKey: true,
293+
});
294+
expect(wrapper.emitted('toggle-full')).toEqual([[defaultProps.item]]);
295+
});
296+
289297
describe('keyboard navigation', () => {
290298
it('clicks the reference link on `@keydown.enter`', () => {
291299
const wrapper = createWrapper();

0 commit comments

Comments
 (0)