-
Notifications
You must be signed in to change notification settings - Fork 319
fix(dialog-box): dialog pop-up mask layer animation is not working (#… #3637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -205,7 +205,6 @@ | |||||||||||||||||||||||||||||||||||||
top: 0; | ||||||||||||||||||||||||||||||||||||||
width: 100%; | ||||||||||||||||||||||||||||||||||||||
height: 100%; | ||||||||||||||||||||||||||||||||||||||
background: var(--tv-DialogBox-mask-bg-color); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.v-modal-enter { | ||||||||||||||||||||||||||||||||||||||
|
@@ -230,10 +229,16 @@ | |||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.dialog-slideRight-enter-active { | ||||||||||||||||||||||||||||||||||||||
animation: slideRight 0.5s ease-in forwards; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-in 0.5s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.dialog-slideRight-leave-active { | ||||||||||||||||||||||||||||||||||||||
animation: slideRightout 0.5s ease-in forwards; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-out 0.5s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes slideRight { | ||||||||||||||||||||||||||||||||||||||
|
@@ -270,15 +275,43 @@ | |||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.tiny-dialog-box__wrapper.has-modal { | ||||||||||||||||||||||||||||||||||||||
background: var(--tv-DialogBox-mask-bg-color); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.dialog-fade-enter-active { | ||||||||||||||||||||||||||||||||||||||
animation: dialog-fade-in 0.3s; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-in 0.3s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
+284
to
287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Unify fade enter/leave fill-mode for consistency Apply the same fill-mode pattern to dialog-fade enter/leave to prevent visual popping at the start/end of the animation. .dialog-fade-enter-active {
animation: dialog-fade-in 0.3s;
&.tiny-dialog-box__wrapper {
- animation: modal-fade-in 0.3s;
+ animation: modal-fade-in 0.3s both;
}
}
.dialog-fade-leave-active {
.@{dialog-box-prefix-cls} {
animation: dialog-fade-out 3s;
}
animation: dialog-fade-out 0.3s;
&.tiny-dialog-box__wrapper {
- animation: modal-fade-out 0.3s;
+ animation: modal-fade-out 0.3s forwards;
}
} Also applies to: 294-297 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.dialog-fade-leave-active { | ||||||||||||||||||||||||||||||||||||||
.@{dialog-box-prefix-cls} { | ||||||||||||||||||||||||||||||||||||||
animation: dialog-fade-out 3s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
animation: dialog-fade-out 0.3s; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-out 0.3s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
289
to
+297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion 3s fade-out on inner dialog likely unintended; align to 0.3s A 3s fade on the inner panel during leave is disproportionately long vs. the 0.3s wrapper fade and other transitions. This looks like a typo. .dialog-fade-leave-active {
.@{dialog-box-prefix-cls} {
- animation: dialog-fade-out 3s;
+ animation: dialog-fade-out 0.3s;
}
animation: dialog-fade-out 0.3s;
&.tiny-dialog-box__wrapper {
animation: modal-fade-out 0.3s forwards;
}
} 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes modal-fade-in { | ||||||||||||||||||||||||||||||||||||||
0% { | ||||||||||||||||||||||||||||||||||||||
opacity: 0; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
100% { | ||||||||||||||||||||||||||||||||||||||
opacity: 1; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes modal-fade-out { | ||||||||||||||||||||||||||||||||||||||
0% { | ||||||||||||||||||||||||||||||||||||||
opacity: 1; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
100% { | ||||||||||||||||||||||||||||||||||||||
opacity: 0; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes dialog-fade-in { | ||||||||||||||||||||||||||||||||||||||
|
@@ -306,7 +339,17 @@ | |||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.enlarge-enter-active { | ||||||||||||||||||||||||||||||||||||||
animation: enlarge-in 350ms linear; | ||||||||||||||||||||||||||||||||||||||
animation: enlarge-in 0.35s linear; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-in 0.35s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
Comment on lines
341
to
+346
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Apply fill-mode to enlarge enter/leave wrapper fades Keep consistency with other transitions and avoid end-of-animation flashes. .enlarge-enter-active {
animation: enlarge-in 0.35s linear;
&.tiny-dialog-box__wrapper {
- animation: modal-fade-in 0.35s;
+ animation: modal-fade-in 0.35s both;
}
}
.enlarge-leave-active {
animation: enlarge-out 0.35s linear;
&.tiny-dialog-box__wrapper {
- animation: modal-fade-out 0.35s;
+ animation: modal-fade-out 0.35s forwards;
}
} Also applies to: 348-353 🤖 Prompt for AI Agents
|
||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
.enlarge-leave-active { | ||||||||||||||||||||||||||||||||||||||
animation: enlarge-out 0.35s linear; | ||||||||||||||||||||||||||||||||||||||
&.tiny-dialog-box__wrapper { | ||||||||||||||||||||||||||||||||||||||
animation: modal-fade-out 0.35s; | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes enlarge-in { | ||||||||||||||||||||||||||||||||||||||
|
@@ -323,6 +366,20 @@ | |||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@keyframes enlarge-out { | ||||||||||||||||||||||||||||||||||||||
0% { | ||||||||||||||||||||||||||||||||||||||
transform: scale(1); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
50% { | ||||||||||||||||||||||||||||||||||||||
transform: scale(0.5); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
100% { | ||||||||||||||||||||||||||||||||||||||
transform: scale(0); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
@media (max-width: 480px) { | ||||||||||||||||||||||||||||||||||||||
.@{dialog-box-prefix-cls} { | ||||||||||||||||||||||||||||||||||||||
width: 100% !important; | ||||||||||||||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -18,7 +18,7 @@ | |||||
> | ||||||
<div | ||||||
v-show="visible" | ||||||
:class="['tiny-dialog-box__wrapper', dialogClass]" | ||||||
:class="['tiny-dialog-box__wrapper', dialogClass, modal ? 'has-modal' : '']" | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainDouble-check modalAppendToBody interaction and pointer event flow With the mask now on the wrapper, ensure:
If issues surface, consider gating has-modal with actual append-to-body state or ensuring wrapper is teleported to body when masking. 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Locate appendToBody/modalAppendToBody handling for dialog-box"
rg -n --no-heading -A 6 -B 6 -S 'appendToBody|modalAppendToBody' packages/vue/src/dialog-box
echo "Check any teleport/portal usage in dialog-box code"
rg -n --no-heading -A 2 -B 2 -S 'Teleport|teleport|appendChild' packages/vue/src/dialog-box packages/vue-renderless Length of output: 3989 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "==== pc.vue (showing with line numbers) ===="
nl -ba packages/vue/src/dialog-box/src/pc.vue | sed -n '1,360p' || true
echo
echo "==== mobile-first.vue (showing with line numbers) ===="
nl -ba packages/vue/src/dialog-box/src/mobile-first.vue | sed -n '1,360p' || true
echo
echo "==== Search for Teleport / teleport in packages/vue ===="
rg -n --no-heading -S 'Teleport|teleport' packages/vue || true
echo
echo "==== Search for appendToBody/modalAppendToBody usage across repo ===="
rg -n --no-heading -S 'appendToBody|modalAppendToBody' || true
echo
echo "==== Search for class 'has-modal' usage across repo ===="
rg -n --no-heading -S "has-modal" || true Length of output: 8541 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "==== packages/vue/src/dialog-box/src/pc.vue ===="
sed -n '1,400p' packages/vue/src/dialog-box/src/pc.vue || true
echo
echo "==== packages/vue/src/dialog-box/src/mobile-first.vue ===="
sed -n '1,400p' packages/vue/src/dialog-box/src/mobile-first.vue || true
echo
echo "==== packages/vue/src/dialog-box/src/index.ts (props) ===="
sed -n '1,240p' packages/vue/src/dialog-box/src/index.ts || true
echo
echo "==== packages/renderless/src/dialog-box/index.ts ===="
sed -n '1,420p' packages/renderless/src/dialog-box/index.ts || true
echo
echo "==== packages/vue-hooks/src/vue-popup.ts ===="
sed -n '1,420p' packages/vue-hooks/src/vue-popup.ts || true
echo
echo "==== packages/theme/src/dialog-box/index.less (around has-modal) ===="
sed -n '250,320p' packages/theme/src/dialog-box/index.less || true Length of output: 30798 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Search for tiny-dialog-box__wrapper usages in theme and styles"
rg -n --no-heading -S "tiny-dialog-box__wrapper" || true
echo
echo "Show full dialog-box theme file"
sed -n '1,400p' packages/theme/src/dialog-box/index.less || true
echo
echo "Search for PopupManager implementation in repo"
rg -n --no-heading -S "class PopupManager|export const PopupManager|function PopupManager|PopupManager =" || true
echo
echo "Search for openModal implementation"
rg -n --no-heading -S "openModal(" || true
echo
echo "Search for v-modal or modal class used by PopupManager (common names)"
rg -n --no-heading -S "v-modal|modal-mask|pop-modal|popLockClass|pop-modal" || true Length of output: 12889 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "==== packages/utils/src/popup-manager/index.ts ===="
sed -n '1,400p' packages/utils/src/popup-manager/index.ts || true Length of output: 6949 Action required — modalAppendToBody vs wrapper mask can be out-of-sync Short summary: I verified the code paths. modalAppendToBody controls where PopupManager inserts the global .v-modal, while appendToBody controls whether the dialog wrapper (tiny-dialog-box__wrapper) is moved to body. The wrapper now carries the visual mask (.has-modal). That combination (modalAppendToBody === true && appendToBody === false — both are defaults) can leave the wrapper trapped by transformed ancestors (so it won't cover the viewport) or otherwise cause layering/pointer issues. What I checked (evidence):
Recommended fixes (pick one):
- :class="['tiny-dialog-box__wrapper', dialogClass, modal ? 'has-modal' : '']"
+ :class="['tiny-dialog-box__wrapper', dialogClass, (modal && (appendToBody || !modalAppendToBody)) ? 'has-modal' : '']" Rationale: if modalAppendToBody === true but the wrapper is not appended to body, don't apply the wrapper mask (avoid trapped/incomplete mask). That leaves PopupManager/.v-modal to provide the mask.
- if (props.appendToBody) {
+ if (props.appendToBody || (props.modal && props.modalAppendToBody)) {
document.body.appendChild(el)
} (and mirror the same predicate when removing the element in unMounted). Rationale: keeps visual mask (has-modal) on the wrapper and avoids transformed-ancestor containment. Extra checks to run after applying either fix:
Files to review:
📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||
@click.self="handleWrapperClick" | ||||||
@mouseup="useMouseEventUp" | ||||||
@mousedown="useMouseEventDown" | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Ensure mask fade has correct fill-mode to avoid end-frame flicker
Add fill-mode to the wrapper’s modal fade animations. Without it, the mask can momentarily snap back to full opacity at the end of leave or have a first-frame pop on enter.
Also applies to: 239-242
🤖 Prompt for AI Agents