@chakra-ui/popper
Advanced tools
Comparing version 1.1.4 to 1.1.5
# Change Log | ||
## 1.1.5 | ||
### Patch Changes | ||
- [`e1924c621`](https://github.com/chakra-ui/chakra-ui/commit/e1924c62182969a109b4900b05932caa1b73ed99) | ||
[#3477](https://github.com/chakra-ui/chakra-ui/pull/3477) Thanks | ||
[@tomdohnal](https://github.com/tomdohnal)! - make the react-popper state in | ||
sync with the internal popper instance state | ||
- Updated dependencies | ||
[[`83ae62905`](https://github.com/chakra-ui/chakra-ui/commit/83ae62905935fdb3104380d6fd845159b00095fa), | ||
[`87cc23e14`](https://github.com/chakra-ui/chakra-ui/commit/87cc23e14814e02cbbfc9737c2356cef682ddd5d)]: | ||
- @chakra-ui/hooks@1.1.5 | ||
- @chakra-ui/utils@1.3.0 | ||
## 1.1.4 | ||
@@ -4,0 +19,0 @@ |
@@ -50,3 +50,7 @@ "use strict"; | ||
var _React$useState = React.useState({ | ||
var _React$useState = React.useState(null), | ||
popperState = _React$useState[0], | ||
setPopperState = _React$useState[1]; | ||
var _React$useState2 = React.useState({ | ||
popper: { | ||
@@ -58,8 +62,8 @@ position: optionsWithDefaults.strategy, | ||
}), | ||
styles = _React$useState[0], | ||
setStyles = _React$useState[1]; | ||
styles = _React$useState2[0], | ||
setStyles = _React$useState2[1]; | ||
var _React$useState2 = React.useState({}), | ||
attrs = _React$useState2[0], | ||
setAttrs = _React$useState2[1]; | ||
var _React$useState3 = React.useState({}), | ||
attrs = _React$useState3[0], | ||
setAttrs = _React$useState3[1]; | ||
@@ -74,2 +78,3 @@ var updateStateModifier = React.useMemo(function () { | ||
var elements = Object.keys(state.elements); | ||
setPopperState(state); | ||
setStyles(resolve(state.styles, elements)); | ||
@@ -129,3 +134,3 @@ setAttrs(resolve(state.attributes, elements)); | ||
return { | ||
state: popperInstanceRef.current ? popperInstanceRef.current.state : null, | ||
state: popperState || null, | ||
styles: styles, | ||
@@ -132,0 +137,0 @@ attributes: attrs, |
@@ -33,2 +33,3 @@ import { useSafeLayoutEffect } from "@chakra-ui/hooks"; | ||
}; | ||
var [popperState, setPopperState] = React.useState(null); | ||
var [styles, setStyles] = React.useState({ | ||
@@ -51,2 +52,3 @@ popper: { | ||
var elements = Object.keys(state.elements); | ||
setPopperState(state); | ||
setStyles(resolve(state.styles, elements)); | ||
@@ -105,3 +107,3 @@ setAttrs(resolve(state.attributes, elements)); | ||
return { | ||
state: popperInstanceRef.current ? popperInstanceRef.current.state : null, | ||
state: popperState || null, | ||
styles, | ||
@@ -108,0 +110,0 @@ attributes: attrs, |
@@ -1,2 +0,2 @@ | ||
import { createPopper as defaultCreatePopper, Options as PopperOptions, VirtualElement } from "@popperjs/core"; | ||
import { createPopper as defaultCreatePopper, Options as PopperOptions, VirtualElement, State as PopperState } from "@popperjs/core"; | ||
import * as React from "react"; | ||
@@ -8,3 +8,3 @@ declare type Options = Partial<PopperOptions> & { | ||
export declare function usePopper(referenceElement: Element | VirtualElement, popperElement: HTMLElement, options?: Options): { | ||
state: import("@popperjs/core").State | null; | ||
state: PopperState | null; | ||
styles: { | ||
@@ -18,5 +18,5 @@ [key: string]: Partial<React.CSSProperties>; | ||
}; | ||
update: (() => Promise<Partial<import("@popperjs/core").State>>) | null; | ||
update: (() => Promise<Partial<PopperState>>) | null; | ||
forceUpdate: (() => void) | null; | ||
}; | ||
export {}; |
{ | ||
"name": "@chakra-ui/popper", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "A React component and hooks wrapper for popper.js", | ||
@@ -59,4 +59,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/hooks": "1.1.4", | ||
"@chakra-ui/utils": "1.2.0", | ||
"@chakra-ui/hooks": "1.1.5", | ||
"@chakra-ui/utils": "1.3.0", | ||
"@popperjs/core": "2.4.4", | ||
@@ -63,0 +63,0 @@ "dequal": "2.0.2" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
94042
809
+ Added@chakra-ui/hooks@1.1.5(transitive)
+ Added@chakra-ui/utils@1.3.0(transitive)
- Removed@chakra-ui/hooks@1.1.4(transitive)
- Removed@chakra-ui/utils@1.2.0(transitive)
Updated@chakra-ui/hooks@1.1.5
Updated@chakra-ui/utils@1.3.0