@faststore/ui 1.6.19 → 1.6.20

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.6.20 (2022-03-24)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * fix dropdown component bug ([#1192](https://github.com/vtex/faststore/issues/1192)) ([f188ac0](https://github.com/vtex/faststore/commit/f188ac0c59db5a0ef7a95eb2412d0bbcd024ae36))
12
+
13
+
14
+
15
+
16
+
6
17
  ## 1.6.19 (2022-03-24)
7
18
 
8
19
 
@@ -1712,15 +1712,16 @@ const DropdownItem = /*#__PURE__*/React.forwardRef(function Button({
1712
1712
  */
1713
1713
 
1714
1714
  const useDropdownPosition = () => {
1715
- var _dropdownButtonRef$cu, _dropdownButtonRef$cu2, _dropdownButtonRef$cu3, _dropdownButtonRef$cu4, _dropdownButtonRef$cu5, _dropdownButtonRef$cu6;
1715
+ var _dropdownButtonRef$cu, _buttonRect$top, _buttonRect$height, _buttonRect$left;
1716
1716
 
1717
1717
  const {
1718
1718
  dropdownButtonRef
1719
1719
  } = useDropdown();
1720
- const topLevel = (_dropdownButtonRef$cu = dropdownButtonRef == null ? void 0 : (_dropdownButtonRef$cu2 = dropdownButtonRef.current) == null ? void 0 : _dropdownButtonRef$cu2.offsetTop) != null ? _dropdownButtonRef$cu : 0;
1721
- const topOffset = (_dropdownButtonRef$cu3 = dropdownButtonRef == null ? void 0 : (_dropdownButtonRef$cu4 = dropdownButtonRef.current) == null ? void 0 : _dropdownButtonRef$cu4.offsetHeight) != null ? _dropdownButtonRef$cu3 : 0;
1720
+ const buttonRect = dropdownButtonRef == null ? void 0 : (_dropdownButtonRef$cu = dropdownButtonRef.current) == null ? void 0 : _dropdownButtonRef$cu.getBoundingClientRect();
1721
+ const topLevel = (_buttonRect$top = buttonRect == null ? void 0 : buttonRect.top) != null ? _buttonRect$top : 0;
1722
+ const topOffset = (_buttonRect$height = buttonRect == null ? void 0 : buttonRect.height) != null ? _buttonRect$height : 0;
1722
1723
  const topPosition = topLevel + topOffset;
1723
- const leftPosition = (_dropdownButtonRef$cu5 = dropdownButtonRef == null ? void 0 : (_dropdownButtonRef$cu6 = dropdownButtonRef.current) == null ? void 0 : _dropdownButtonRef$cu6.offsetLeft) != null ? _dropdownButtonRef$cu5 : 0;
1724
+ const leftPosition = (_buttonRect$left = buttonRect == null ? void 0 : buttonRect.left) != null ? _buttonRect$left : 0;
1724
1725
  return {
1725
1726
  position: 'absolute',
1726
1727
  top: topPosition,