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(ui5-li-notification): enhance accessibility #9192

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions packages/fiori/src/NotificationListItem.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,15 @@
</div>
{{/if}}

<div id="{{_id}}-footer" class="ui5-nli-footer">
{{#each footerItems}}
<slot name="{{slotName}}"></slot>
{{#if showDivider}}
<div class="ui5-nli-footer-divider" aria-hidden="true">·</div>
{{/if}}
{{/each}}

<div class="ui5-nli-footer">
<div id="{{_id}}-footnotes" class="ui5-nli-footnotes">
{{#each footerItems}}
<slot name="{{slotName}}"></slot>
{{#if showDivider}}
<div class="ui5-nli-footer-divider" aria-hidden="true">·</div>
{{/if}}
{{/each}}
</div>
<ui5-link
class="ui5-nli-footer-showMore"
?hidden="{{hideShowMore}}"
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori/src/NotificationListItem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ class NotificationListItem extends NotificationListItemBase {
}

if (this.hasFootNotes) {
ids.push(`${id}-footer`);
ids.push(`${id}-footnotes`);
}

return ids.join(" ");
Expand Down
4 changes: 4 additions & 0 deletions packages/fiori/src/themes/NotificationListItem.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
margin-inline: 0.5rem;
}

.ui5-nli-footnotes {
display: flex;
}

.ui5-nli-footer-showMore {
margin-inline-start: 1rem;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/fiori/test/specs/NotificationList.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,21 +223,21 @@ describe("Notification List Item Tests", () => {
const titleTextId = `${await firstItem.getProperty("_id")}-title-text`;
const readId = `${await firstItem.getProperty("_id")}-read`;
const descriptionId = `${await firstItem.getProperty("_id")}-description`;
const footerId = `${await firstItem.getProperty("_id")}-footer`;
const footerId = `${await firstItem.getProperty("_id")}-footnotes`;
const EXPECTED_ARIA_LABELLED_BY = `${titleTextId} ${readId} ${descriptionId} ${footerId}`;

const importantId3 = `${await thirdItem.getProperty("_id")}-importance`;
const titleTextId3 = `${await thirdItem.getProperty("_id")}-title-text`;
const readId3 = `${await thirdItem.getProperty("_id")}-read`;
const descriptionId3 = `${await thirdItem.getProperty("_id")}-description`;
const footerId3 = `${await thirdItem.getProperty("_id")}-footer`;
const footerId3 = `${await thirdItem.getProperty("_id")}-footnotes`;
const EXPECTED_ARIA_LABELLED_BY3 = `${importantId3} ${titleTextId3} ${readId3} ${descriptionId3} ${footerId3}`;

const loadingId4 = `${await loadingItem.getProperty("_id")}-loading`;
const titleTextId4 = `${await loadingItem.getProperty("_id")}-title-text`;
const readId4 = `${await loadingItem.getProperty("_id")}-read`;
const descriptionId4 = `${await loadingItem.getProperty("_id")}-description`;
const footerId4 = `${await loadingItem.getProperty("_id")}-footer`;
const footerId4 = `${await loadingItem.getProperty("_id")}-footnotes`;
const EXPECTED_ARIA_LABELLED_BY4 = `${titleTextId4} ${loadingId4} ${readId4} ${descriptionId4} ${footerId4}`;

// assert
Expand Down