Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sidePanel): resolve storybook doc page scroll issues #6664

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
cf72a26
refactor(useFocus): refactor repeated useEffect code
makafsal Nov 18, 2024
7d8f719
Merge remote-tracking branch 'upstream/main'
makafsal Nov 25, 2024
cdee198
Merge remote-tracking branch 'upstream/main'
makafsal Nov 25, 2024
f41bacf
Merge remote-tracking branch 'upstream/main'
makafsal Nov 28, 2024
97d5942
Merge remote-tracking branch 'upstream/main'
makafsal Dec 3, 2024
e7b5615
Merge remote-tracking branch 'upstream/main'
makafsal Dec 6, 2024
ddb1121
Merge remote-tracking branch 'upstream/main'
makafsal Dec 11, 2024
0aa4d5c
Merge remote-tracking branch 'upstream/main'
makafsal Dec 11, 2024
83bd974
chore: merge from main
makafsal Dec 16, 2024
4846f19
Merge remote-tracking branch 'upstream/main'
makafsal Dec 17, 2024
7d1cb44
Merge remote-tracking branch 'upstream/main'
makafsal Dec 18, 2024
09be114
Merge remote-tracking branch 'upstream/main'
makafsal Dec 19, 2024
00778df
Merge remote-tracking branch 'upstream/main'
makafsal Jan 6, 2025
c579614
fix(sidepanel): resolve width issue in storybook
makafsal Jan 6, 2025
325d082
fix(sidepanel): check for storybook or not
makafsal Jan 6, 2025
6050bb3
fix(sidepanel): remove unwanted div from storybook
makafsal Jan 6, 2025
90e2def
fix(sidepanel): remove storybook related from component
makafsal Jan 7, 2025
7bbe263
fix(sidepanel): remove body style in storybook doc page
makafsal Jan 7, 2025
7918dca
Merge remote-tracking branch 'upstream/main' into bug-6623
makafsal Jan 21, 2025
376c1e7
fix(sidePanel): revert the div id and class
makafsal Jan 21, 2025
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import styles from './_storybook-styles.scss?inline';
import React, { useRef, useState } from 'react';
import React, { useEffect, useRef, useState } from 'react';
import { action } from '@storybook/addon-actions';
import {
Button,
Expand Down Expand Up @@ -472,6 +472,12 @@ const SlideOverTemplate = (
const testRef = useRef(undefined);
const buttonRef = useRef(undefined);

useEffect(() => {
if (context.viewMode === 'docs') {
document.body.style.overflow = '';
}
}, [open]);

return (
<>
<Button
Expand Down Expand Up @@ -506,6 +512,12 @@ const FirstElementDisabledTemplate = (
const testRef = useRef(undefined);
const buttonRef = useRef(undefined);

useEffect(() => {
if (context.viewMode === 'docs') {
document.body.style.overflow = '';
}
}, [open]);

return (
<>
<Button
Expand Down Expand Up @@ -570,6 +582,12 @@ const StepTemplate = (
const [currentStep, setCurrentStep] = useState(0);
const buttonRef = useRef(undefined);

useEffect(() => {
if (context.viewMode === 'docs') {
document.body.style.overflow = '';
}
}, [open]);

return (
<>
<Button
Expand Down Expand Up @@ -608,18 +626,22 @@ const SlideInTemplate = (
const [open, setOpen] = useState(context.viewMode !== 'docs');
const buttonRef = useRef(undefined);

useEffect(() => {
if (context.viewMode === 'docs') {
document.body.style.overflow = '';
}
}, [open]);

return (
<>
<div class={`${prefix}story-container`}>
<div class={`${prefix}story-content`} id="ibm-products-page-content">
<Button
ref={buttonRef}
onClick={() => setOpen(!open)}
className={`${prefix}toggle`}
>
{open ? 'Close side panel' : 'Open side panel'}
</Button>
</div>
<div class={`${prefix}story-content`} id="ibm-products-page-content">
<Button
ref={buttonRef}
onClick={() => setOpen(!open)}
className={`${prefix}toggle`}
>
{open ? 'Close side panel' : 'Open side panel'}
</Button>
</div>
<SidePanel
{...args}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ $story-prefix: side-panel-stories__;
height: 100%;
}

.#{$story-prefix}story-container {
position: fixed;
display: grid;
block-size: 100vh;
grid-template-rows: 3rem 1fr;
inline-size: 100vw;
inset-block-start: 0;
inset-inline-start: 0;
}

.#{$story-prefix}story-content {
position: relative;
display: flex;
Expand Down
Loading