@vygruppen/spor-react 12.13.0 → 12.13.1

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vygruppen/spor-react",
3
3
  "type": "module",
4
- "version": "12.13.0",
4
+ "version": "12.13.1",
5
5
  "exports": {
6
6
  ".": {
7
7
  "types": "./dist/index.d.ts",
@@ -58,7 +58,7 @@ export const CountryCodeSelect = forwardRef<
58
58
  sideRadiusVariant={"rightSideSquare"}
59
59
  >
60
60
  {callingCodes.items.map((code) => (
61
- <SelectItem as={"option"} key={code.label} item={code}>
61
+ <SelectItem key={code.label} item={code}>
62
62
  {code.label}
63
63
  </SelectItem>
64
64
  ))}
@@ -7,6 +7,7 @@ import {
7
7
  Overlay,
8
8
  usePopover,
9
9
  } from "react-aria";
10
+ import ReactDOM from "react-dom";
10
11
  import { OverlayTriggerState } from "react-stately";
11
12
 
12
13
  type PopoverProps = {
@@ -54,7 +55,7 @@ type PopoverProps = {
54
55
  /**
55
56
  * Internal popover component.
56
57
  *
57
- * Used to render accessible popover content, like a dropdown menu or a card select. Should not be used directly, but as a part of Spor components.
58
+ * Used to render accessible popover content, only used in ComboBox.
58
59
  */
59
60
  export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
60
61
  (
@@ -95,6 +96,8 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
95
96
  {...popoverProps}
96
97
  ref={popoverRef}
97
98
  minWidth={triggerRef.current?.clientWidth ?? "auto"}
99
+ position="absolute"
100
+ zIndex={1400}
98
101
  >
99
102
  <DismissButton onDismiss={state.close} />
100
103
  {children}
@@ -103,6 +106,10 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
103
106
  );
104
107
 
105
108
  if (isNonModal) {
109
+ // Render in a portal to ensure it does not take up semantic space
110
+ if (globalThis.window !== undefined && typeof document !== "undefined") {
111
+ return ReactDOM.createPortal(popoverBox, document.body);
112
+ }
106
113
  return popoverBox;
107
114
  }
108
115
  return (