@eturnity/eturnity_reusable_components 8.7.5-qa-16-02-21.2 → 8.7.5-qa-16-02-21.3
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
@@ -48,13 +48,13 @@
|
|
48
48
|
props.backdrop == 'dark'
|
49
49
|
? 'rgba(0, 0, 0, 0.4)'
|
50
50
|
: 'rgba(255, 255, 255, 0.9)'};
|
51
|
-
z-index:
|
51
|
+
z-index: 9999999;
|
52
52
|
overflow: auto;
|
53
53
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
`
|
54
|
+
@media (max-width: 425px) {
|
55
|
+
background: white;
|
56
|
+
}
|
57
|
+
`
|
58
58
|
|
59
59
|
const modalContainerAttrs = { overflow: String }
|
60
60
|
const ModalContainer = styled('div', modalContainerAttrs)`
|
@@ -152,22 +152,40 @@
|
|
152
152
|
isOpen: {
|
153
153
|
immediate: true,
|
154
154
|
handler(isOpen) {
|
155
|
-
|
156
|
-
if (isOpen) {
|
157
|
-
window.addEventListener('keydown', this.handleKeyDown)
|
158
|
-
} else {
|
155
|
+
this.setElementsStyle(isOpen)
|
156
|
+
if (!isOpen) {
|
159
157
|
window.removeEventListener('keydown', this.handleKeyDown)
|
160
158
|
}
|
161
159
|
},
|
162
160
|
},
|
163
161
|
},
|
164
162
|
beforeUnmount() {
|
165
|
-
|
163
|
+
this.setElementsStyle(false)
|
166
164
|
window.removeEventListener('keydown', this.handleKeyDown)
|
167
165
|
},
|
168
166
|
methods: {
|
167
|
+
setElementsStyle(isOpen) {
|
168
|
+
this.setSelectDropdownsStyle(isOpen)
|
169
|
+
document.body.style.overflow = isOpen ? 'hidden' : null
|
170
|
+
},
|
171
|
+
setSelectDropdownsStyle(isOpen) {
|
172
|
+
const zIndex = isOpen ? '9999999' : '99999'
|
173
|
+
const items = document.getElementsByClassName('rc-select-dropdown')
|
174
|
+
|
175
|
+
const updateZIndex = () => {
|
176
|
+
Array.from(items).forEach((item) => {
|
177
|
+
item.style.zIndex = zIndex
|
178
|
+
})
|
179
|
+
}
|
180
|
+
|
181
|
+
if (isOpen) {
|
182
|
+
setTimeout(updateZIndex, 100)
|
183
|
+
} else {
|
184
|
+
updateZIndex()
|
185
|
+
}
|
186
|
+
},
|
169
187
|
onCloseModal() {
|
170
|
-
|
188
|
+
this.setElementsStyle(false)
|
171
189
|
this.$emit('on-close')
|
172
190
|
},
|
173
191
|
handleKeyDown({ key }) {
|