fix: DatePicker/Select fix outsideClickListener inside web components
parent
07c5dc2ef7
commit
2323dd92f8
|
@ -1096,7 +1096,8 @@ export default {
|
|||
}
|
||||
},
|
||||
isOutsideClicked(event) {
|
||||
return !(this.$el.isSameNode(event.target) || this.isNavIconClicked(event) || this.$el.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
|
||||
const composedPath = event.composedPath();
|
||||
return !(this.$el.isSameNode(event.target) || this.isNavIconClicked(event) || composedPath.includes(this.$el) || composedPath.includes(this.overlay));
|
||||
},
|
||||
isNavIconClicked(event) {
|
||||
return (this.previousButton && (this.previousButton.isSameNode(event.target) || this.previousButton.contains(event.target))) || (this.nextButton && (this.nextButton.isSameNode(event.target) || this.nextButton.contains(event.target)));
|
||||
|
|
|
@ -727,7 +727,8 @@ export default {
|
|||
bindOutsideClickListener() {
|
||||
if (!this.outsideClickListener) {
|
||||
this.outsideClickListener = (event) => {
|
||||
if (this.overlayVisible && this.overlay && !this.$el.contains(event.target) && !this.overlay.contains(event.target)) {
|
||||
const composedPath = event.composedPath();
|
||||
if (this.overlayVisible && this.overlay && !composedPath.includes(this.$el) && !composedPath.includes(this.overlay)) {
|
||||
this.hide();
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue