File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed
packages/vue-final-modal/src/components/CoreModal Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -75,18 +75,12 @@ const {
75
75
leaveTransition,
76
76
} = useTransition (props , {
77
77
modelValueLocal ,
78
- async onEntering () {
78
+ onEnter () {
79
79
focus ()
80
- await nextTick ()
81
80
disableBodyScroll ()
82
- },
83
- onEnter() {
84
81
emitEvent (' opened' )
85
82
resolveToggle (' opened' )
86
83
},
87
- onLeaving() {
88
- blur ()
89
- },
90
84
onLeave() {
91
85
deleteFromOpenedModals (getModalInstance ())
92
86
focusLast ()
@@ -158,6 +152,7 @@ function close() {
158
152
enableBodyScroll ()
159
153
deleteFromOpenedModalOverlays (modalInstance )
160
154
openLastOverlay ()
155
+ blur ()
161
156
leaveTransition ()
162
157
}
163
158
Original file line number Diff line number Diff line change @@ -34,10 +34,10 @@ export function useTransition(
34
34
props : InstanceType < typeof CoreModal > [ '$props' ] ,
35
35
options : {
36
36
modelValueLocal : Ref < boolean >
37
- onEntering : ( ) => void
38
- onEnter : ( ) => void
39
- onLeaving : ( ) => void
40
- onLeave : ( ) => void
37
+ onEntering ? : ( ) => void
38
+ onEnter ? : ( ) => void
39
+ onLeaving ? : ( ) => void
40
+ onLeave ? : ( ) => void
41
41
} ,
42
42
) : {
43
43
visible : Ref < boolean >
@@ -83,13 +83,13 @@ export function useTransition(
83
83
watch ( contentState , ( state ) => {
84
84
switch ( state ) {
85
85
case TransitionState . Entering :
86
- return onEntering ( )
86
+ return onEntering ?. ( )
87
87
case TransitionState . Enter :
88
- return onEnter ( )
88
+ return onEnter ?. ( )
89
89
case TransitionState . Leaving :
90
- return onLeaving ( )
90
+ return onLeaving ?. ( )
91
91
case TransitionState . Leave :
92
- return onLeave ( )
92
+ return onLeave ?. ( )
93
93
}
94
94
} )
95
95
You can’t perform that action at this time.
0 commit comments