@jetbrains/ring-ui 4.0.42 → 4.0.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -17,11 +17,11 @@ const {
17
17
  const defaultAriaLabel = 'Dropdown menu';
18
18
 
19
19
  function DropdownAnchorWrapper({anchor, pinned, active, activeListItemId, listId, ...restProps}) {
20
- const anchorAriaProps = useMemo(() => (
21
- active && activeListItemId
22
- ? {'aria-owns': listId, 'aria-activedescendant': activeListItemId}
23
- : {}
24
- ), [active, activeListItemId, listId]);
20
+ const anchorAriaProps = useMemo(() => ({
21
+ ...(listId ? {'aria-haspopup': 'true'} : {}),
22
+ ...(activeListItemId ? {'aria-activedescendant': activeListItemId, 'aria-owns': listId} : {}),
23
+ ...(active ? {'aria-expanded': 'true'} : {})
24
+ }), [active, activeListItemId, listId]);
25
25
 
26
26
  const anchorProps = useMemo(
27
27
  () => ({active, pinned, ...restProps, ...anchorAriaProps}),
@@ -40,7 +40,7 @@ function DropdownAnchorWrapper({anchor, pinned, active, activeListItemId, listId
40
40
  return anchor(anchorProps);
41
41
  }
42
42
  if (!Array.isArray(anchor)) {
43
- return cloneElement(anchor, anchorProps);
43
+ return cloneElement(anchor, typeof anchor.type === 'string' ? anchorAriaProps : anchorProps);
44
44
  }
45
45
  return (
46
46
  <div {...anchorAriaProps}>{anchor}</div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jetbrains/ring-ui",
3
- "version": "4.0.42",
3
+ "version": "4.0.43",
4
4
  "description": "JetBrains UI library",
5
5
  "author": "JetBrains",
6
6
  "license": "Apache-2.0",
@@ -207,5 +207,5 @@
207
207
  "node": ">=7.4",
208
208
  "npm": ">=6.0.0"
209
209
  },
210
- "gitHead": "e61c7bc48bbba6e2763359ab0904e34a91272f84"
210
+ "gitHead": "ef0147be4eea764b49b5cd663b3daf92a56e0618"
211
211
  }