Skip to content

Commit

Permalink
fix(OnyxInput): prevent keyboard focus on clear icon (#2337)
Browse files Browse the repository at this point in the history
Relates to #2143 

As discussed with Jannick, the clear icon is no longer focusable via
keyboard to not interrupt the users tab order when multiple form
elements are used.
  • Loading branch information
larsrickert authored Dec 16, 2024
1 parent 62aca04 commit d8fe4ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 7 additions & 0 deletions .changeset/breezy-cups-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"sit-onyx": patch
---

fix(OnyxInput): prevent keyboard focus on clear icon

The clear icon is no longer focusable via keyboard to not interrupt the users tab order when multiple form elements are used.
9 changes: 2 additions & 7 deletions packages/sit-onyx/src/components/OnyxInput/OnyxInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const errorClass = useErrorClass(showError);
class="onyx-input__clear"
:aria-label="t('input.clear')"
:title="t('input.clear')"
tabindex="-1"
@click="() => (value = '')"
>
<OnyxIcon :icon="xSmall" />
Expand Down Expand Up @@ -161,15 +162,9 @@ const errorClass = useErrorClass(showError);
cursor: pointer;
color: var(--onyx-color-text-icons-neutral-intense);
&:hover,
&:focus-visible {
&:hover {
color: var(--onyx-color-text-icons-primary-intense);
}
&:focus-visible {
outline: var(--onyx-outline-width) solid var(--onyx-color-component-focus-primary);
border-radius: var(--onyx-radius-sm);
}
}
// hide clear icon when input is not focussed
Expand Down

0 comments on commit d8fe4ca

Please sign in to comment.