Closed Eldemarkki closed 2 years ago
Seems like an issue with popper.js
Some investigation notes on this:
withinPortal
is trueDateRangePicker.tsx
fixes this, but there's still very slight visual jank (looks like it's shifting up by a pixel). Seems like it would be wise to just avoid dynamically modifying siblings of the date range picker instead of having the Mantine library fix this?
const handleValueChange = (range: [Date, Date]) => {
setValue(range);
window.dispatchEvent(new Event('scroll'));
if (closeCalendarOnChange && validationRule(range)) {
setDropdownOpened(false);
onDropdownClose?.();
window.setTimeout(() => inputRef.current?.focus(), 0);
}
};
I think it does not really worth fixing, in v5 we will migrate to floating ui and disable portals by default, for now, set withinPortal={false}
What package has an issue
@mantine/dates
Describe the bug
If you create a DateRangePicker and a list with data that depends on the value of the DateRangerPicker, the picker dialog will jump around. Here's a video to show the bug:
https://user-images.githubusercontent.com/38920928/159139584-965c77e9-042e-481c-94f2-d69b2bd90b78.mp4
In which browser did the problem occur
Firefox and Chrome
If possible, please include a link to a codesandbox with the reproduced problem
https://codesandbox.io/s/unruffled-cdn-xj438w
Do you know how to fix the issue
No
Are you willing to participate in fixing this issue and create a pull request with the fix
No response
Possible fix
No response