@equinor/eds-core-react 0.41.3 → 0.41.4-dev03092024

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.
@@ -6398,9 +6398,11 @@ const Popover$1 = /*#__PURE__*/react.forwardRef(function Popover({
6398
6398
  const {
6399
6399
  getFloatingProps
6400
6400
  } = react$1.useInteractions([react$1.useDismiss(context)]);
6401
- edsUtils.useIsomorphicLayoutEffect(() => {
6401
+ react.useEffect(() => {
6402
6402
  if (open) {
6403
- refs.floating.current?.showPopover();
6403
+ if (refs.floating.current?.isConnected) {
6404
+ refs.floating.current.showPopover();
6405
+ }
6404
6406
  } else {
6405
6407
  refs.floating.current?.hidePopover();
6406
6408
  }
@@ -1,6 +1,6 @@
1
1
  import { forwardRef, useRef, useMemo, useEffect } from 'react';
2
2
  import styled, { css, ThemeProvider } from 'styled-components';
3
- import { typographyTemplate, bordersTemplate, outlineTemplate, mergeRefs, useIsomorphicLayoutEffect, useToken } from '@equinor/eds-utils';
3
+ import { typographyTemplate, bordersTemplate, outlineTemplate, mergeRefs, useToken } from '@equinor/eds-utils';
4
4
  import { popover } from './Popover.tokens.js';
5
5
  import { useFloating, offset, flip, shift, arrow, autoUpdate, useInteractions, useDismiss, FloatingFocusManager } from '@floating-ui/react';
6
6
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
@@ -96,9 +96,11 @@ const Popover = /*#__PURE__*/forwardRef(function Popover({
96
96
  const {
97
97
  getFloatingProps
98
98
  } = useInteractions([useDismiss(context)]);
99
- useIsomorphicLayoutEffect(() => {
99
+ useEffect(() => {
100
100
  if (open) {
101
- refs.floating.current?.showPopover();
101
+ if (refs.floating.current?.isConnected) {
102
+ refs.floating.current.showPopover();
103
+ }
102
104
  } else {
103
105
  refs.floating.current?.hidePopover();
104
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/eds-core-react",
3
- "version": "0.41.3",
3
+ "version": "0.41.4-dev03092024",
4
4
  "description": "The React implementation of the Equinor Design System",
5
5
  "sideEffects": [
6
6
  "**/*.css"
@@ -85,12 +85,12 @@
85
85
  "@react-stately/calendar": "^3.5.3",
86
86
  "@react-stately/datepicker": "^3.10.1",
87
87
  "@react-types/shared": "^3.24.1",
88
- "@tanstack/react-virtual": "3.8.4",
89
- "downshift": "9.0.7",
88
+ "@tanstack/react-virtual": "3.10.6",
89
+ "downshift": "9.0.8",
90
90
  "react-aria": "^3.34.1",
91
- "@equinor/eds-tokens": "0.9.2",
92
91
  "@equinor/eds-icons": "^0.21.0",
93
- "@equinor/eds-utils": "0.8.5"
92
+ "@equinor/eds-utils": "0.8.5",
93
+ "@equinor/eds-tokens": "0.9.2"
94
94
  },
95
95
  "scripts": {
96
96
  "build": "rollup -c --bundleConfigAsCjs && tsc -p tsconfig.build.json",