Skip to content
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@uifabric/utilities",
"comment": "Modify mergeAriaAttributeValues to return space delimited string of values",
"type": "patch"
}
],
"packageName": "@uifabric/utilities",
"email": "keco@microsoft.com"
}
4 changes: 1 addition & 3 deletions packages/utilities/src/aria.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
* ARIA helper to concatenate attributes, returning undefined if all attributes
* are undefined. (Empty strings are not a valid ARIA attribute value.)
*
* NOTE: This function will NOT insert whitespace between provided attributes.
*
* @param ariaAttributes - ARIA attributes to merge
*/
export function mergeAriaAttributeValues(...ariaAttributes: (string | undefined)[]): string | undefined {
const mergedAttribute = ariaAttributes.filter((arg: string | undefined) => arg !== undefined && arg !== null).join('');
const mergedAttribute = ariaAttributes.filter((arg: string | undefined) => arg !== undefined && arg !== null).join(' ');

@Dalimil Dalimil Feb 21, 2019

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we have .join(' ').trim() maybe?

return mergedAttribute === '' ? undefined : mergedAttribute;
}