File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ WithProps.args = {
3030 onChange : action ( 'onChange' ) ,
3131 onClose : action ( 'onClose' ) ,
3232 positionFixed : false ,
33+ container : undefined ,
3334} ;
3435
3536export 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+ 'body' 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+ } ;
You can’t perform that action at this time.
0 commit comments