From 56ac451bebb55a8d8163fb9ccd38acb236f1eb99 Mon Sep 17 00:00:00 2001 From: Roman Barlos Date: Tue, 17 Oct 2023 11:38:06 +0300 Subject: [PATCH 1/2] fix(CompositeBar): recalc mounted PopupPosition if compact mode changed (#138) --- .../__stories__/AsideHeaderShowcase.tsx | 1 + src/components/CompositeBar/Item/Item.tsx | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx b/src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx index 4c97a3c..aafab0a 100644 --- a/src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx +++ b/src/components/AsideHeader/__stories__/AsideHeaderShowcase.tsx @@ -155,6 +155,7 @@ export const AsideHeaderShowcase: FC = ({ popupPlacement={['right-end']} popupOffset={[-20, 10]} onClosePopup={() => setPopupVisible(false)} + popupKeepMounted={true} renderPopupContent={() => { return (
diff --git a/src/components/CompositeBar/Item/Item.tsx b/src/components/CompositeBar/Item/Item.tsx index fda11dd..46eed3d 100644 --- a/src/components/CompositeBar/Item/Item.tsx +++ b/src/components/CompositeBar/Item/Item.tsx @@ -102,6 +102,19 @@ export const Item: React.FC = (props) => { const iconSize = item.iconSize || ASIDE_HEADER_ICON_SIZE; const collapsedItem = item.id === COLLAPSE_ITEM_ID; + const modifiers: Required['modifiers'] = React.useMemo( + () => [ + { + name: 'compact', + enabled: true, + options: {compact}, + phase: 'main', + fn() {}, + }, + ], + [compact], + ); + const onClose = React.useCallback( (event: MouseEvent | KeyboardEvent) => { if ( @@ -191,6 +204,7 @@ export const Item: React.FC = (props) => { offset={popupOffset} anchorRef={anchorRef} onClose={onClose} + modifiers={modifiers} > {renderPopupContent()} From b4985570736e549fa65105b86aa0e9b21403d241 Mon Sep 17 00:00:00 2001 From: Gravity UI Bot <111915794+gravity-ui-bot@users.noreply.github.com> Date: Tue, 17 Oct 2023 11:53:39 +0300 Subject: [PATCH 2/2] chore(main): release 1.1.2 (#139) --- CHANGELOG.md | 7 +++++++ package-lock.json | 2 +- package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3fed154..2bd4cd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.1.2](https://github.com/gravity-ui/navigation/compare/v1.1.1...v1.1.2) (2023-10-17) + + +### Bug Fixes + +* **CompositeBar:** recalc mounted PopupPosition if compact mode changed ([#138](https://github.com/gravity-ui/navigation/issues/138)) ([56ac451](https://github.com/gravity-ui/navigation/commit/56ac451bebb55a8d8163fb9ccd38acb236f1eb99)) + ## [1.1.1](https://github.com/gravity-ui/navigation/compare/v1.1.0...v1.1.1) (2023-10-13) diff --git a/package-lock.json b/package-lock.json index a6f752b..f393692 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@gravity-ui/navigation", - "version": "1.1.1", + "version": "1.1.2", "lockfileVersion": 1, "requires": true, "packages": { diff --git a/package.json b/package.json index 27ca84c..578925d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@gravity-ui/navigation", - "version": "1.1.1", + "version": "1.1.2", "description": "Gravity UI Navigation components", "license": "MIT", "repository": {