@eturnity/eturnity_reusable_components 8.7.5-qa-16-02-21.5 → 8.7.5-qa-16-02-21.6
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/package.json
CHANGED
@@ -162,6 +162,7 @@
|
|
162
162
|
:hovered-index="hoveredIndex"
|
163
163
|
:hovered-value="hoveredValue"
|
164
164
|
:is-active="isActive"
|
165
|
+
:is-fixed-dropdown-position="isFixedDropdownPosition"
|
165
166
|
:is-parent-modal="isParentModal"
|
166
167
|
:min-width="minWidth"
|
167
168
|
:no-relative="noRelative"
|
@@ -394,12 +395,14 @@
|
|
394
395
|
noRelative: Boolean,
|
395
396
|
minWidth: String,
|
396
397
|
isParentModal: Boolean,
|
398
|
+
isFixedDropdownPosition: Boolean,
|
397
399
|
}
|
398
400
|
const SelectDropdown = styled('div', selectDropdownAttrs)`
|
399
401
|
box-sizing: border-box;
|
400
402
|
z-index: ${(props) =>
|
401
403
|
props.isActive ? '2' : props.isParentModal ? '9999999' : '99999'};
|
402
|
-
position:
|
404
|
+
position: ${(props) =>
|
405
|
+
props.isFixedDropdownPosition ? 'fixed' : 'absolute'};
|
403
406
|
top: 0px;
|
404
407
|
left: 0px;
|
405
408
|
border: ${BORDER_WIDTH} solid ${(props) => props.theme.colors.grey4};
|
@@ -649,6 +652,11 @@
|
|
649
652
|
type: String,
|
650
653
|
required: false,
|
651
654
|
},
|
655
|
+
isFixedDropdownPosition: {
|
656
|
+
type: Boolean,
|
657
|
+
required: false,
|
658
|
+
default: false,
|
659
|
+
},
|
652
660
|
},
|
653
661
|
|
654
662
|
data() {
|
@@ -750,7 +758,7 @@
|
|
750
758
|
}, 10)
|
751
759
|
await this.$nextTick()
|
752
760
|
this.handleSetDropdownOffet()
|
753
|
-
this.calculateSelectTopPosition()
|
761
|
+
if (!this.isFixedDropdownPosition) this.calculateSelectTopPosition()
|
754
762
|
} else {
|
755
763
|
this.dropdownPosition.left = null
|
756
764
|
if (this.animationFrameId) {
|
@@ -788,7 +796,11 @@
|
|
788
796
|
this.observeDropdownHeight()
|
789
797
|
this.observeSelectWidth()
|
790
798
|
window.addEventListener('resize', this.handleSetDropdownOffet)
|
791
|
-
|
799
|
+
if (!this.isFixedDropdownPosition)
|
800
|
+
document.body.addEventListener(
|
801
|
+
'scroll',
|
802
|
+
this.calculateSelectTopPosition
|
803
|
+
)
|
792
804
|
},
|
793
805
|
beforeMount() {
|
794
806
|
this.selectedValue = this.value
|
@@ -797,10 +809,12 @@
|
|
797
809
|
window.removeEventListener('resize', this.handleSetDropdownOffet)
|
798
810
|
if (this.dropdownResizeObserver) this.dropdownResizeObserver.disconnect()
|
799
811
|
if (this.selectResizeObserver) this.selectResizeObserver.disconnect()
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
812
|
+
if (!this.isFixedDropdownPosition) {
|
813
|
+
document.body.removeEventListener(
|
814
|
+
'scroll',
|
815
|
+
this.calculateSelectTopPosition
|
816
|
+
)
|
817
|
+
}
|
804
818
|
},
|
805
819
|
unmounted() {
|
806
820
|
document.removeEventListener('click', this.clickOutside)
|