You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When upgrading to version v7.4.0, react-onclickoutside has been removed as part of this release: #4979
This however will reintroduce an old bug from here: #1928
Specifically, when the datepicker is open, clicking anywhere, including trying to click the datepicker popup content's itself, will automatically close the datepicker pop up without registering the click.
To Reproduce
Steps to reproduce the behavior:
Install version 7.4.0 of react-datepicker
Create a shadow root component
Insert a general Datepicker component with minimal setup i.e selected + onchange handler inside the shadow root component
Open the datepicker by clicking it
Attempt to click anything inside the datepicker popup (NOK -> will close the datepicker popup on a "mousedown" event)
Expected behavior
Datepicker pop up should not close on a mousedown event and should instead register the click appropriately.
Screenshots
Example datepicker:
Example render:
Example html:
Desktop (please complete the following information):
OS: Windows 10
Browser: Chrome
Version: 129.0.6668.71 (Official Build) (32-bit)
Smartphone (please complete the following information):
NA
Additional context
Downgrading to v7.3.0, the datepicker works fine. Only present in v7.4.0
The text was updated successfully, but these errors were encountered:
gunavata
changed the title
Removal of react-onclickoutside reintroduces bug calender closing when wrapping with shadow-dom
Calendar not clickable when wrapped with shadow-dom - Removal of react-onclickoutside reintroduces bug
Oct 11, 2024
@gunavata I originally removed it because react-onclickoutside is not going to be compatible with React 19
If you can give me a reproduction example, I will take a look
@hamidrezahanafi Here is a codesandbox reproducing this issue. I face this issue as well. The CSS is not applied under the shadowroot, but you can still attempt to click the buttons to show the behavior described above.
Describe the bug
When upgrading to version v7.4.0, react-onclickoutside has been removed as part of this release:
#4979
This however will reintroduce an old bug from here:
#1928
Specifically, when the datepicker is open, clicking anywhere, including trying to click the datepicker popup content's itself, will automatically close the datepicker pop up without registering the click.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Datepicker pop up should not close on a mousedown event and should instead register the click appropriately.
Screenshots
Example datepicker:
Example render:
Example html:
Desktop (please complete the following information):
Smartphone (please complete the following information):
NA
Additional context
Downgrading to v7.3.0, the datepicker works fine. Only present in v7.4.0
The text was updated successfully, but these errors were encountered: