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
Steps to reproduce
I've integrated the vue2-datepicker with the 'append-to-body' flag set to true, and the component works properly. However, when I change it to false (since I'm integrating it into a web component), it correctly places the popup in the right DOM element. However, upon selecting a date (including any click inside the popup), it closes the popup without capturing the selected date or date range.
I've identified a potential solution. It appears that the issue can be associated with the Shadow DOM generated by the web component. In this scenario, the handleClickOutside method in the popup.vue file is not effectively managing the DOM. Would the following code serve as an appropriate fix for releasing a new version of your component?
handleClickOutside(evt) {
if (!this.visible) return;
const el = this.$el;
if (el && !evt.composedPath().includes(el)) {
this.$emit('clickoutside', evt);
}
},
Vue2-datepicker version: 3.11.1
Vue version: 2.6.11
Browser: chrome
Steps to reproduce
I've integrated the vue2-datepicker with the 'append-to-body' flag set to true, and the component works properly. However, when I change it to false (since I'm integrating it into a web component), it correctly places the popup in the right DOM element. However, upon selecting a date (including any click inside the popup), it closes the popup without capturing the selected date or date range.
Reproduction Link or Source Code
And in the js:
Thank you for your work.
The text was updated successfully, but these errors were encountered: