Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/blue-suns-tickle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@alfalab/core-components-popover': patch
'@alfalab/core-components': patch
---

##### Popover

- Позиционирование Popover теперь использует `strategy: 'fixed'`, чтобы поповер с большим контентом не увеличивал `documentElement.scrollHeight` и не ломал скролл страницы.
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ exports[`Snapshots tests should display opened correctly 2`] = `
data-popper-escaped="true"
data-popper-placement="bottom-start"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 50; position: fixed; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner popoverInner cc-picker-button optionsPopover"
Expand Down Expand Up @@ -681,7 +681,7 @@ exports[`Snapshots tests should display opened correctly 4`] = `
data-popper-escaped="true"
data-popper-placement="bottom-start"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 50; position: fixed; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner popoverInner cc-picker-button optionsPopover"
Expand Down Expand Up @@ -1141,7 +1141,7 @@ exports[`Snapshots tests should display opened correctly 6`] = `
data-popper-escaped="true"
data-popper-placement="bottom-start"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 50; position: fixed; left: 0px; top: 0px; right: auto; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner popoverInner cc-picker-button optionsPopover"
Expand Down
1 change: 1 addition & 0 deletions packages/popover/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ export const Popover = forwardRef<HTMLDivElement, PopoverProps>(
} = usePopper(referenceElement, popperElement, {
placement: position,
modifiers: popperModifiers,
strategy: 'fixed',
});

if (updatePopper) {
Expand Down
4 changes: 2 additions & 2 deletions packages/popover/src/__snapshots__/Component.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`Display tests should display correctly 1`] = `
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 50; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner"
Expand Down Expand Up @@ -96,7 +96,7 @@ exports[`Render tests should render without Transition of withTransition is fals
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 50; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner"
Expand Down
4 changes: 2 additions & 2 deletions packages/toast/src/__snapshots__/component.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ exports[`Toast Snapshots tests should math snapshot when prop \`anchorElement\`
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 1000; width: 0px; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 1000; width: 0px; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner popoverInner"
Expand Down Expand Up @@ -116,7 +116,7 @@ exports[`Toast Snapshots tests should math snapshot when prop \`anchorElement\`
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 1000; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
style="z-index: 1000; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(0px, 0px);"
>
<div
class="inner popoverInner"
Expand Down
4 changes: 2 additions & 2 deletions packages/tooltip/src/__snapshots__/Component.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ exports[`Display tests should display correctly if tooltip open 1`] = `
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(-16px, 0px);"
style="z-index: 50; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(-16px, 0px);"
>
<div
class="inner popper tooltip tooltip popper"
Expand Down Expand Up @@ -200,7 +200,7 @@ exports[`Display tests should display correctly if tooltip open with view \`hint
data-popper-escaped="true"
data-popper-placement="left"
data-popper-reference-hidden="true"
style="z-index: 50; position: absolute; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(-16px, 0px);"
style="z-index: 50; position: fixed; left: auto; top: 0px; right: 0px; bottom: auto; transform: translate(-16px, 0px);"
>
<div
class="inner popper hint hint hint"
Expand Down
42 changes: 42 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -20115,6 +20115,14 @@ react-remove-scroll-bar@^2.3.3:
react-style-singleton "^2.2.1"
tslib "^2.0.0"

react-remove-scroll-bar@^2.3.7:
version "2.3.8"
resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.8.tgz#99c20f908ee467b385b68a3469b4a3e750012223"
integrity sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q==
dependencies:
react-style-singleton "^2.2.2"
tslib "^2.0.0"

react-remove-scroll@2.5.5:
version "2.5.5"
resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77"
Expand All @@ -20126,6 +20134,17 @@ react-remove-scroll@2.5.5:
use-callback-ref "^1.3.0"
use-sidecar "^1.1.2"

react-remove-scroll@^2.5.5:
version "2.7.2"
resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.7.2.tgz#6442da56791117661978ae99cd29be9026fecca0"
integrity sha512-Iqb9NjCCTt6Hf+vOdNIZGdTiH1QSqr27H/Ek9sv/a97gfueI/5h1s3yRi1nngzMUaOOToin5dI1dXKdXiF+u0Q==
dependencies:
react-remove-scroll-bar "^2.3.7"
react-style-singleton "^2.2.3"
tslib "^2.1.0"
use-callback-ref "^1.3.3"
use-sidecar "^1.1.3"

react-scripts@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-5.0.1.tgz#6285dbd65a8ba6e49ca8d651ce30645a6d980003"
Expand Down Expand Up @@ -20219,6 +20238,14 @@ react-style-singleton@^2.2.1:
invariant "^2.2.4"
tslib "^2.0.0"

react-style-singleton@^2.2.2, react-style-singleton@^2.2.3:
version "2.2.3"
resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.3.tgz#4265608be69a4d70cfe3047f2c6c88b2c3ace388"
integrity sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ==
dependencies:
get-nonce "^1.0.0"
tslib "^2.0.0"

react-swipeable@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/react-swipeable/-/react-swipeable-7.0.0.tgz#7a12570ee435d35ac700511de338384aa78d12cd"
Expand Down Expand Up @@ -23540,6 +23567,13 @@ use-callback-ref@^1.3.2:
dependencies:
tslib "^2.0.0"

use-callback-ref@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.3.tgz#98d9fab067075841c5b2c6852090d5d0feabe2bf"
integrity sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg==
dependencies:
tslib "^2.0.0"

use-composed-ref@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.3.0.tgz#3d8104db34b7b264030a9d916c5e94fbe280dbda"
Expand Down Expand Up @@ -23572,6 +23606,14 @@ use-sidecar@^1.1.2:
detect-node-es "^1.1.0"
tslib "^2.0.0"

use-sidecar@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.3.tgz#10e7fd897d130b896e2c546c63a5e8233d00efdb"
integrity sha512-Fedw0aZvkhynoPYlA5WXrMCAMm+nSWdZt6lzJQ7Ok8S6Q+VsHmHpRWndVRJ8Be0ZbkfPc5LRYH+5XrzXcEeLRQ==
dependencies:
detect-node-es "^1.1.0"
tslib "^2.0.0"

use-sync-external-store@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.4.0.tgz#adbc795d8eeb47029963016cefdf89dc799fcebc"
Expand Down