Skip to content

Commit 19dbda3

Browse files
fix: add story
1 parent 7b5ed01 commit 19dbda3

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/components/Input/DateInput.stories.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ WithProps.args = {
3030
onChange: action('onChange'),
3131
onClose: action('onClose'),
3232
positionFixed: false,
33+
container: undefined,
3334
};
3435

3536
export const WithId = (args) => (
@@ -163,3 +164,34 @@ export const CalendarCustomDay = (args) => (
163164
/>
164165
</div>
165166
);
167+
168+
export const WithContainer = (args) => (
169+
<div>
170+
<p>
171+
The container prop allows you to specify where the dropdown menu is rendered. Use
172+
&apos;body&apos; to avoid z-index issues or provide a custom container element.
173+
</p>
174+
<div
175+
id="constrained-container"
176+
style={{
177+
position: 'relative',
178+
overflow: 'hidden',
179+
height: '320px',
180+
border: '1px solid #ccc',
181+
padding: '10px',
182+
}}
183+
>
184+
<p>This container has overflow: hidden and limited height</p>
185+
<DateInput container="body" placeholder="Container = body" {...args} />
186+
<br />
187+
<br />
188+
<DateInput container="#constrained-container" placeholder="Container = this div" {...args} />
189+
<br />
190+
<br />
191+
<DateInput placeholder="Default positioning (may be clipped)" {...args} />
192+
</div>
193+
</div>
194+
);
195+
WithContainer.args = {
196+
onChange: action('onChange'),
197+
};

0 commit comments

Comments
 (0)