Skip to content

Commit 14fa824

Browse files
authored
Fix focus on link button in toolbar (#7639)
2 parents 52d7220 + a227f59 commit 14fa824

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

packages/components/src/components/toolbar/shadow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export class KolToolbar implements ToolbarAPI {
3636
};
3737

3838
return '_href' in element ? (
39-
<KolLinkWcTag {...element} {...props} ref={catchRef}></KolLinkWcTag>
39+
<KolLinkWcTag {...element} {...props} ref={catchRef} _role="button"></KolLinkWcTag>
4040
) : (
4141
<KolButtonWcTag {...element} {...props} ref={catchRef}></KolButtonWcTag>
4242
);

packages/components/src/components/toolbar/style.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
@use '../@shared/mixins' as *;
22
@use '../../styles/global' as *;
33
@use '../tooltip/style.scss' as *;
4+
@use '../@shared/kol-button-mixin' as *;
5+
6+
@include kol-button-styles('kol-link');
47

58
@layer kol-component {
69
.kol-toolbar {

packages/components/src/components/toolbar/test/__snapshots__/snapshot.spec.tsx.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ exports[`kol-toolbar should render with _label="Text" _items=[{"_label":"Button"
55
<template shadowrootmode="open">
66
<div aria-label="Text" class="kol-toolbar" role="toolbar">
77
<kol-button-wc _label="Button" _tabindex="0" class="button kol-toolbar__item normal"></kol-button-wc>
8-
<kol-link-wc _href="#" _label="Link" _tabindex="-1" class="button kol-toolbar__item normal"></kol-link-wc>
8+
<kol-link-wc _href="#" _label="Link" _role="button" _tabindex="-1" class="button kol-toolbar__item normal"></kol-link-wc>
99
</div>
1010
</template>
1111
</kol-toolbar>

0 commit comments

Comments
 (0)