File tree Expand file tree Collapse file tree 4 files changed +31
-3
lines changed
Expand file tree Collapse file tree 4 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ export default Vue.extend({
188188 if ( this . noFocus !== true ) {
189189 document . activeElement . blur ( )
190190
191- this . $nextTick ( ( ) => {
191+ this . __nextModelTick ( ( ) => {
192192 this . focus ( )
193193 } )
194194 }
Original file line number Diff line number Diff line change @@ -138,7 +138,7 @@ export default Vue.extend({
138138 document . activeElement . blur ( )
139139 }
140140
141- this . $nextTick ( ( ) => {
141+ this . __nextModelTick ( ( ) => {
142142 this . updatePosition ( )
143143 this . noFocus !== true && this . focus ( )
144144 } )
Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export default Vue.extend({
7676
7777 this . __showPortal ( )
7878
79- this . $nextTick ( ( ) => {
79+ this . __nextModelTick ( ( ) => {
8080 this . updatePosition ( )
8181 this . __configureScrollTarget ( )
8282 } )
Original file line number Diff line number Diff line change @@ -53,7 +53,9 @@ export default {
5353 this . $emit ( 'before-show' , evt )
5454
5555 if ( this . __show !== void 0 ) {
56+ this . __clearModelTick ( )
5657 this . __show ( evt )
58+ this . __prepareModelTick ( )
5759 }
5860 else {
5961 this . $emit ( 'show' , evt )
@@ -87,7 +89,9 @@ export default {
8789 this . $emit ( 'before-hide' , evt )
8890
8991 if ( this . __hide !== void 0 ) {
92+ this . __clearModelTick ( )
9093 this . __hide ( evt )
94+ this . __prepareModelTick ( )
9195 }
9296 else {
9397 this . $emit ( 'hide' , evt )
@@ -101,6 +105,30 @@ export default {
101105 else if ( val !== this . showing ) {
102106 this [ `__process${ val === true ? 'Show' : 'Hide' } ` ] ( this . payload )
103107 }
108+ } ,
109+
110+ __nextModelTick ( fn ) {
111+ this . nextModelTick = fn
112+ } ,
113+
114+ __prepareModelTick ( ) {
115+ if ( this . nextModelTick !== void 0 ) {
116+ const fn = this . nextModelTick
117+ this . $nextTick ( ( ) => {
118+ if ( this . nextModelTick === fn ) {
119+ this . nextModelTick ( )
120+ this . nextModelTick = void 0
121+ }
122+ } )
123+ }
124+ } ,
125+
126+ __clearModelTick ( ) {
127+ this . nextModelTick = void 0
104128 }
129+ } ,
130+
131+ beforeDestroy ( ) {
132+ this . nextModelTick = void 0
105133 }
106134}
You can’t perform that action at this time.
0 commit comments