Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core/event-list): add focus-visible outline #1467

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
5 changes: 5 additions & 0 deletions .changeset/gold-owls-whisper.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@siemens/ix": patch
---

fix(core/event-list): add focus-visible outline
11 changes: 11 additions & 0 deletions packages/core/src/components/event-list-item/event-list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ $default-event-list-item-height: 2.5rem;

:host {
@include ix-component;
display: block;
position: relative;

.event-list-item {
display: flex;
Expand Down Expand Up @@ -129,4 +131,13 @@ $default-event-list-item-height: 2.5rem;
}
}

:host(:focus) {
outline: none;
}

:host(:focus-visible) {
outline: 1px solid var(--theme-color-focus-bdr);
outline-offset: var(--theme-btn--focus--outline-offset);
}

@include host-disabled;
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class EventListItem {

return (
<Host
tabIndex="0"
class={{
disabled: this.disabled,
}}
Expand Down
15 changes: 15 additions & 0 deletions packages/core/src/tests/event-list/event-list.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,19 @@ regressionTest.describe('event-list', () => {
await (await page.waitForSelector('text="Text 3"')).hover();
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline', async ({ page }) => {
await page.goto('event-list/basic');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});

regressionTest('outline selected', async ({ page }) => {
await page.goto('event-list/basic');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
await page.keyboard.press('Tab');
expect(await page.screenshot({ fullPage: true })).toMatchSnapshot();
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading