Private
Public Access
1
0
Files
power-apps-codeapps-blog-part2/node_modules/@fluentui/react-list/lib/utils/calculateListRole.js

15 lines
540 B
JavaScript

/**
* Calculate the role for the list based on the navigation mode and selectable state
* @param navigationMode - the navigation mode of the list
* @param selectable - whether the list is selectable
* @returns 'grid' if navigationMode is 'composite', otherwise 'listbox' if selectable or 'list' if not
*/ export const calculateListRole = (navigationMode, selectable)=>{
if (navigationMode === 'composite') {
return 'grid';
} else if (selectable) {
return 'listbox';
} else {
return 'list';
}
};