From 03c31fc3625afadc16d6eb2ca7d91c898bf18de6 Mon Sep 17 00:00:00 2001 From: Afsal K Date: Mon, 23 Dec 2024 12:07:41 +0530 Subject: [PATCH 1/2] fix(SidePanel): resolve storybook SlideOver animation flickering in doc page (#6554) * refactor(useFocus): refactor repeated useEffect code * fix(SidePanel): resolve storybook flickering issue * fix(SidePanel): resolve storybook flickering issue --- .../SidePanel/SidePanel.docs-page.js | 2 +- .../src/components/SidePanel/SidePanel.tsx | 34 +++++++++---------- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js b/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js index 12911e413c..36f1c36bb5 100644 --- a/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js +++ b/packages/ibm-products/src/components/SidePanel/SidePanel.docs-page.js @@ -8,7 +8,7 @@ import React from 'react'; import { StoryDocsPage } from '../../global/js/utils/StoryDocsPage'; -import * as stories from './SidePanel'; +import * as stories from './SidePanel.stories'; const DocsPage = () => ( { - if (open) { - setTimeout(() => { + if (open && animationComplete) { + if ( + selectorPrimaryFocus && + getSpecificElement(sidePanelRef?.current, selectorPrimaryFocus) + ) { + const primeFocusEl = getSpecificElement( + sidePanelRef?.current, + selectorPrimaryFocus + ); if ( - selectorPrimaryFocus && - getSpecificElement(sidePanelRef?.current, selectorPrimaryFocus) + primeFocusEl && + window?.getComputedStyle(primeFocusEl)?.display !== 'none' ) { - const primeFocusEl = getSpecificElement( - sidePanelRef?.current, - selectorPrimaryFocus - ); - if ( - primeFocusEl && - window?.getComputedStyle(primeFocusEl)?.display !== 'none' - ) { - (primeFocusEl as HTMLElement)?.focus(); - } - } else if (!slideIn) { - firstElement?.focus(); + setTimeout(() => primeFocusEl?.focus(), 0); } - }, 0); + } else if (!slideIn) { + setTimeout(() => firstElement?.focus(), 0); + } } }, [ animationComplete, From dbcba3a83ccd57d37afb71fe83423217a68f08a8 Mon Sep 17 00:00:00 2001 From: carbon-bot Date: Mon, 23 Dec 2024 23:59:41 +0000 Subject: [PATCH 2/2] chore(telemetry): update telemetry config --- packages/ibm-products/telemetry.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ibm-products/telemetry.yml b/packages/ibm-products/telemetry.yml index 248c74a6ca..be04f5afec 100644 --- a/packages/ibm-products/telemetry.yml +++ b/packages/ibm-products/telemetry.yml @@ -456,14 +456,17 @@ collect: - editButtonText - editing - editSuccess + - editSuccessMessage - editSuccessTitle - errorText - generateButtonText - generateSuccessBody + - generateSuccessMessage - generateSuccessTitle - generateTitle - hasAPIKeyVisibilityToggle - hasDownloadLink + - helperText - hideAPIKeyLabel - loadingText - modalLabel @@ -532,6 +535,7 @@ collect: - fixedIsVisible # CoachmarkOverlayElements - isVisible + - onBack # CoachmarkStackHome - onClickNavItem # Columns