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

chore: add shouldBlockScroll stories #4351

Open
wants to merge 3 commits into
base: canary
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
21 changes: 21 additions & 0 deletions packages/components/dropdown/stories/dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ export default {
disable: true,
},
},
shouldBlockScroll: {
control: {
type: "boolean",
},
},
},
decorators: [
(Story) => (
Expand Down Expand Up @@ -815,3 +820,19 @@ export const WithFallbackPlacements = {
</div>
),
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
</div>
);
},

args: {
...defaultProps,
shouldBlockScroll: true,
},
};
17 changes: 17 additions & 0 deletions packages/components/modal/stories/modal.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* eslint-disable jsx-a11y/anchor-is-valid */
/* eslint-disable jsx-a11y/no-autofocus */
import React from "react";
import {Meta} from "@storybook/react";
import {modal} from "@nextui-org/theme";
import {Button} from "@nextui-org/button";
Expand Down Expand Up @@ -348,3 +349,19 @@ export const DraggableOverflow = {
...defaultProps,
},
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
ryo-manba marked this conversation as resolved.
Show resolved Hide resolved
</div>
);
},

args: {
...defaultProps,
shouldBlockScroll: true,
},
};
16 changes: 16 additions & 0 deletions packages/components/popover/stories/popover.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -575,3 +575,19 @@ export const CustomMotion = {
},
},
};

export const WithShouldBlockScroll = {
render: (args) => {
return (
<div className="flex gap-8">
<Template {...args} label="shouldBlockScroll: false" shouldBlockScroll={false} />
<Template {...args} label="shouldBlockScroll: true" shouldBlockScroll={true} />
ryo-manba marked this conversation as resolved.
Show resolved Hide resolved
</div>
);
},

args: {
...defaultProps,
shouldBlockScroll: true,
},
};
Loading