From bdcea4350ae12331a0ced4e9c8bd36580efb58b4 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 15 May 2019 13:30:05 +0200 Subject: [PATCH 1/2] fix(Popup): fix positioning in scrollable container --- CHANGELOG.md | 1 + .../src/components/Popup/createPopperReferenceProxy.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7bfddb09b..215e23f9b4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixes - Fixed `Flex.Item` children prop type @mnajdova ([#1320](https://github.com/stardust-ui/react/pull/1320)) - Fixed `Icon`'s color example to align with the latest color updates @mnajdova([#1336](https://github.com/stardust-ui/react/pull/1336)) +- Fixed handle refs on updates of `innerRef` prop in `Ref` component @layershifter ([#1331](https://github.com/stardust-ui/react/pull/1331)) ### Features - Add `selected`, `isFromKeyboard` props to `DropdownItem` @mnajdova ([#1299](https://github.com/stardust-ui/react/pull/1299)) diff --git a/packages/react/src/components/Popup/createPopperReferenceProxy.ts b/packages/react/src/components/Popup/createPopperReferenceProxy.ts index 59bd7249c7..48aca30e5a 100644 --- a/packages/react/src/components/Popup/createPopperReferenceProxy.ts +++ b/packages/react/src/components/Popup/createPopperReferenceProxy.ts @@ -21,6 +21,15 @@ class ReferenceProxy implements PopperJS.ReferenceObject { get clientHeight() { return this.getBoundingClientRect().height } + + /** + * Required to allow properly finding a node to attach scroll. + * + * @see https://github.com/FezVrasta/popper.js/blob/v1.15.0/packages/popper/src/utils/getParentNode.js#L12 + */ + get parentNode() { + return this.ref.current ? this.ref.current.parentNode : undefined + } } /** From ff432432a8833fc8f2a6b459017182e310d09db4 Mon Sep 17 00:00:00 2001 From: Oleksandr Fediashov Date: Wed, 15 May 2019 14:04:54 +0200 Subject: [PATCH 2/2] add CH entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 215e23f9b4..c6b70f18a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Fixed `Flex.Item` children prop type @mnajdova ([#1320](https://github.com/stardust-ui/react/pull/1320)) - Fixed `Icon`'s color example to align with the latest color updates @mnajdova([#1336](https://github.com/stardust-ui/react/pull/1336)) - Fixed handle refs on updates of `innerRef` prop in `Ref` component @layershifter ([#1331](https://github.com/stardust-ui/react/pull/1331)) +- Fixed positioing of `Popup` in scrollable container @layershifter ([#1341](https://github.com/stardust-ui/react/pull/1341)) ### Features - Add `selected`, `isFromKeyboard` props to `DropdownItem` @mnajdova ([#1299](https://github.com/stardust-ui/react/pull/1299))