Skip to content

Commit 317aeee

Browse files
committed
fix: lock state will not change overflow style in drawer and modal
* Modal和Drawer的锁定状态不再修改overflow样式
1 parent ca94ca9 commit 317aeee

File tree

2 files changed

+26
-37
lines changed

2 files changed

+26
-37
lines changed

packages/@core/ui-kit/popup-ui/src/drawer/drawer.vue

+13-19
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,17 @@ const {
8282
zIndex,
8383
} = usePriorityValues(props, state);
8484
85-
watch(
86-
() => showLoading.value,
87-
(v) => {
88-
if (v && wrapperRef.value) {
89-
wrapperRef.value.scrollTo({
90-
// behavior: 'smooth',
91-
top: 0,
92-
});
93-
}
94-
},
95-
);
85+
// watch(
86+
// () => showLoading.value,
87+
// (v) => {
88+
// if (v && wrapperRef.value) {
89+
// wrapperRef.value.scrollTo({
90+
// // behavior: 'smooth',
91+
// top: 0,
92+
// });
93+
// }
94+
// },
95+
// );
9696
9797
function interactOutside(e: Event) {
9898
if (!closeOnClickModal.value || submitting.value) {
@@ -266,19 +266,13 @@ const getForceMount = computed(() => {
266266
ref="wrapperRef"
267267
:class="
268268
cn('relative flex-1 overflow-y-auto p-3', contentClass, {
269-
'overflow-hidden': showLoading,
269+
'pointer-events-none': showLoading || submitting,
270270
})
271271
"
272272
>
273-
<VbenLoading
274-
v-if="showLoading || submitting"
275-
class="size-full"
276-
spinning
277-
/>
278-
279273
<slot></slot>
280274
</div>
281-
275+
<VbenLoading v-if="showLoading || submitting" spinning />
282276
<SheetFooter
283277
v-if="showFooter"
284278
:class="

packages/@core/ui-kit/popup-ui/src/modal/modal.vue

+13-18
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,17 @@ watch(
123123
{ immediate: true },
124124
);
125125
126-
watch(
127-
() => [showLoading.value, submitting.value],
128-
([l, s]) => {
129-
if ((s || l) && wrapperRef.value) {
130-
wrapperRef.value.scrollTo({
131-
// behavior: 'smooth',
132-
top: 0,
133-
});
134-
}
135-
},
136-
);
126+
// watch(
127+
// () => [showLoading.value, submitting.value],
128+
// ([l, s]) => {
129+
// if ((s || l) && wrapperRef.value) {
130+
// wrapperRef.value.scrollTo({
131+
// // behavior: 'smooth',
132+
// top: 0,
133+
// });
134+
// }
135+
// },
136+
// );
137137
138138
function handleFullscreen() {
139139
props.modalApi?.setState((prev) => {
@@ -274,18 +274,13 @@ function handleClosed() {
274274
ref="wrapperRef"
275275
:class="
276276
cn('relative min-h-40 flex-1 overflow-y-auto p-3', contentClass, {
277-
'overflow-hidden': showLoading || submitting,
277+
'pointer-events-none': showLoading || submitting,
278278
})
279279
"
280280
>
281-
<VbenLoading
282-
v-if="showLoading || submitting"
283-
class="size-full h-auto min-h-full"
284-
spinning
285-
/>
286281
<slot></slot>
287282
</div>
288-
283+
<VbenLoading v-if="showLoading || submitting" spinning />
289284
<VbenIconButton
290285
v-if="fullscreenButton"
291286
class="hover:bg-accent hover:text-accent-foreground text-foreground/80 flex-center absolute right-10 top-3 hidden size-6 rounded-full px-1 text-lg opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none sm:block"

0 commit comments

Comments
 (0)