From 7187eef6c2af3e508fd9d36d41dce084d02e3b2f Mon Sep 17 00:00:00 2001 From: Tomi Virkki Date: Tue, 17 Dec 2024 10:46:55 +0200 Subject: [PATCH] docs: improve virtual list item accessible name generator docs --- packages/virtual-list/src/vaadin-virtual-list-mixin.d.ts | 4 ++++ packages/virtual-list/src/vaadin-virtual-list-mixin.js | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/packages/virtual-list/src/vaadin-virtual-list-mixin.d.ts b/packages/virtual-list/src/vaadin-virtual-list-mixin.d.ts index d19c2be17a..f5918d8e55 100644 --- a/packages/virtual-list/src/vaadin-virtual-list-mixin.d.ts +++ b/packages/virtual-list/src/vaadin-virtual-list-mixin.d.ts @@ -55,6 +55,10 @@ export declare class VirtualListMixinClass { /** * A function that generates accessible names for virtual list items. + * The function gets the item as an argument and the + * return value should be a string representing that item. The + * result gets applied to the corresponding virtual list child element + * as an `aria-label` attribute. */ itemAccessibleNameGenerator?: (item: TItem) => string; diff --git a/packages/virtual-list/src/vaadin-virtual-list-mixin.js b/packages/virtual-list/src/vaadin-virtual-list-mixin.js index 0b58300970..ad75540294 100644 --- a/packages/virtual-list/src/vaadin-virtual-list-mixin.js +++ b/packages/virtual-list/src/vaadin-virtual-list-mixin.js @@ -38,6 +38,10 @@ export const VirtualListMixin = (superClass) => /** * A function that generates accessible names for virtual list items. + * The function gets the item as an argument and the + * return value should be a string representing that item. The + * result gets applied to the corresponding virtual list child element + * as an `aria-label` attribute. */ itemAccessibleNameGenerator: { type: Function,