@cscfi/csc-ui 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/c-autocomplete_34.cjs.entry.js +10 -1
- package/dist/cjs/c-autocomplete_34.cjs.entry.js.map +1 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js +10 -1
- package/dist/collection/components/c-dropdown/c-dropdown.js.map +1 -1
- package/dist/components/c-dropdown2.js +10 -1
- package/dist/components/c-dropdown2.js.map +1 -1
- package/dist/csc-ui/csc-ui.esm.js +1 -1
- package/dist/csc-ui/p-4f54f704.entry.js +2 -0
- package/dist/csc-ui/p-4f54f704.entry.js.map +1 -0
- package/dist/esm/c-autocomplete_34.entry.js +10 -1
- package/dist/esm/c-autocomplete_34.entry.js.map +1 -1
- package/dist/types/components/c-dropdown/c-dropdown.d.ts +2 -0
- package/package.json +1 -1
- package/dist/csc-ui/p-48a5469a.entry.js +0 -2
- package/dist/csc-ui/p-48a5469a.entry.js.map +0 -1
|
@@ -654,6 +654,7 @@ const CDropdown = class {
|
|
|
654
654
|
this._debounce = null;
|
|
655
655
|
this._isMobile = false;
|
|
656
656
|
this._listItems = [];
|
|
657
|
+
this._isOpening = false;
|
|
657
658
|
this._inputSize = {
|
|
658
659
|
height: 0,
|
|
659
660
|
width: 0,
|
|
@@ -677,6 +678,8 @@ const CDropdown = class {
|
|
|
677
678
|
});
|
|
678
679
|
}
|
|
679
680
|
async stateWatcher(isOpen) {
|
|
681
|
+
if (isOpen)
|
|
682
|
+
this._handleOpen();
|
|
680
683
|
this.dropdownStateChange.emit(isOpen);
|
|
681
684
|
this._scrollParent = this._scrollParent || (await getScrollParent(this.el));
|
|
682
685
|
this._scrollParent.style.overflow = isOpen ? 'hidden' : null;
|
|
@@ -722,6 +725,12 @@ const CDropdown = class {
|
|
|
722
725
|
_setIsMobile() {
|
|
723
726
|
this._isMobile = window.matchMedia('only screen and (max-width: 760px)').matches;
|
|
724
727
|
}
|
|
728
|
+
_handleOpen() {
|
|
729
|
+
this._isOpening = true;
|
|
730
|
+
setTimeout(() => {
|
|
731
|
+
this._isOpening = false;
|
|
732
|
+
}, 500);
|
|
733
|
+
}
|
|
725
734
|
componentDidLoad() {
|
|
726
735
|
this._setIsMobile();
|
|
727
736
|
this._hideDetails = this.parent.hideDetails;
|
|
@@ -730,7 +739,7 @@ const CDropdown = class {
|
|
|
730
739
|
if (!this._dialog.open)
|
|
731
740
|
return;
|
|
732
741
|
requestAnimationFrame(() => {
|
|
733
|
-
if (!Array.isArray(entries) || !entries.length)
|
|
742
|
+
if (!Array.isArray(entries) || !entries.length || this._isOpening)
|
|
734
743
|
return;
|
|
735
744
|
this._setIsMobile();
|
|
736
745
|
this.close();
|