updates for the suggestion (#297)
Co-authored-by: Makhmudjon Inadullaev <makhmudjon@Makhmudjons-MacBook-Pro-2.local>
Makhmudjon Inadullaev committed
Nov 1, 2022 at 11:47 UTC
efc48c5431912d00619ba6463bf08cf74443e561
1 file changed
+5
-3
theme/src/components/variant-select.js
+5
-3
@@ -42,7 +42,7 @@ function VariantSelect(props) {
42
const variantPages = NavHierarchy.getVariantsForPage(props.root, vp.page);
43
const items = [];
44
let selectedItem = variantPages[0];
45
-
45
+
46
if (variantPages.length === 0) {
47
return null;
48
}
@@ -73,6 +73,7 @@ function VariantSelect(props) {
73
}
74
items.push(
75
<a
76
+ id={match.variant.shortName}
77
style={{ textDecoration: 'none' }}
78
tabIndex={0}
79
key={match.variant.title}
@@ -99,8 +100,9 @@ function VariantSelect(props) {
100
}
101
102
return (
102
- <div ref={wrapper}>
103
- <Dropdown onKeyDown={onDropDownKeyDown} overlay={props.overlay}>
103
+ <div style={{ display: 'flex', flexDirection: 'column' }} ref={wrapper}>
104
+ <label id="label-versions-list-item" htmlFor='variant-select'>Select CLI Version:</label>
105
+ <Dropdown id="versions-list-item" aria-labelledby={selectedItem?.variant?.shortName} onKeyDown={onDropDownKeyDown} overlay={props.overlay}>
106
<VariantSelect.Button aria-label='Version release'>{selectedItem.variant.title}</VariantSelect.Button>
107
<VariantSelect.Menu direction={props.direction} width={props.menuWidth}>
108
{items}