@lumx/react 3.9.2-alpha.7 → 3.9.2-alpha.8

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/package.json CHANGED
@@ -6,8 +6,8 @@
6
6
  "url": "https://github.com/lumapps/design-system/issues"
7
7
  },
8
8
  "dependencies": {
9
- "@lumx/core": "^3.9.2-alpha.7",
10
- "@lumx/icons": "^3.9.2-alpha.7",
9
+ "@lumx/core": "^3.9.2-alpha.8",
10
+ "@lumx/icons": "^3.9.2-alpha.8",
11
11
  "@popperjs/core": "^2.5.4",
12
12
  "body-scroll-lock": "^3.1.5",
13
13
  "classnames": "^2.3.2",
@@ -110,5 +110,5 @@
110
110
  "build:storybook": "storybook build"
111
111
  },
112
112
  "sideEffects": false,
113
- "version": "3.9.2-alpha.7"
113
+ "version": "3.9.2-alpha.8"
114
114
  }
@@ -81,7 +81,7 @@ export const Tooltip: Comp<TooltipProps, HTMLDivElement> = forwardRef((props, re
81
81
 
82
82
  const [popperElement, setPopperElement] = useState<null | HTMLElement>(null);
83
83
  const [anchorElement, setAnchorElement] = useState<null | HTMLElement>(null);
84
- const { styles, attributes } = usePopper(anchorElement, popperElement, {
84
+ const { styles, attributes, update } = usePopper(anchorElement, popperElement, {
85
85
  placement,
86
86
  modifiers: [
87
87
  {
@@ -104,6 +104,11 @@ export const Tooltip: Comp<TooltipProps, HTMLDivElement> = forwardRef((props, re
104
104
  ariaLinkMode: ariaLinkMode as any,
105
105
  });
106
106
 
107
+ // Update on open
108
+ React.useEffect(() => {
109
+ if (isOpen) update?.();
110
+ }, [isOpen, update]);
111
+
107
112
  const labelLines = label ? label.split('\n') : [];
108
113
 
109
114
  const tooltipRef = useMergeRefs(ref, setPopperElement, onPopperMount);