Fix props of 'react-day-picker' #23591)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
4baea52111
Коммит
49dddaa0f0
@@ -34,11 +34,11 @@ const DatePicker = ({children, datePickerProps, isPopperOpen, handlePopperOpenSt
|
|||||||
const {x, y, reference, floating, strategy, context} = useFloating({
|
const {x, y, reference, floating, strategy, context} = useFloating({
|
||||||
open: isPopperOpen,
|
open: isPopperOpen,
|
||||||
onOpenChange: () => handlePopperOpenState(false),
|
onOpenChange: () => handlePopperOpenState(false),
|
||||||
placement: 'bottom',
|
placement: 'bottom-start',
|
||||||
whileElementsMounted: autoUpdate,
|
whileElementsMounted: autoUpdate,
|
||||||
middleware: [
|
middleware: [
|
||||||
offset(5),
|
offset(5),
|
||||||
flip({fallbackPlacements: ['bottom', 'right'], padding: 5}),
|
flip({fallbackPlacements: ['bottom-end', 'top-start', 'top-end', 'right-start', 'left-start'], padding: 5}),
|
||||||
shift(),
|
shift(),
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
@@ -82,23 +82,23 @@ const DatePicker = ({children, datePickerProps, isPopperOpen, handlePopperOpenSt
|
|||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
ref={floating}
|
ref={floating}
|
||||||
|
style={{
|
||||||
|
position: strategy,
|
||||||
|
top: y ?? 0,
|
||||||
|
left: x ?? 0,
|
||||||
|
width: 'auto',
|
||||||
|
zIndex: 999,
|
||||||
|
}}
|
||||||
|
{...getFloatingProps()}
|
||||||
>
|
>
|
||||||
<DayPicker
|
<DayPicker
|
||||||
{...datePickerProps}
|
{...datePickerProps}
|
||||||
style={{
|
|
||||||
position: strategy,
|
|
||||||
top: y ?? 0,
|
|
||||||
left: x ?? 0,
|
|
||||||
width: 'auto',
|
|
||||||
zIndex: 999,
|
|
||||||
}}
|
|
||||||
className='date-picker__popper'
|
className='date-picker__popper'
|
||||||
locale={loadedLocales[locale]}
|
locale={loadedLocales[locale]}
|
||||||
components={{
|
components={{
|
||||||
IconRight: iconRight,
|
IconRight: iconRight,
|
||||||
IconLeft: iconLeft,
|
IconLeft: iconLeft,
|
||||||
}}
|
}}
|
||||||
{...getFloatingProps}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user