File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export const FormControlMixin = dedupeMixin(
145145 * will requires a `await nextFrame()` in tests
146146 */
147147 _registerFormElement ( ) {
148- requestAnimationFrame ( ( ) => {
148+ this . updateComplete . then ( ( ) => {
149149 this . dispatchEvent (
150150 new CustomEvent ( 'form-element-register' , {
151151 detail : { element : this } ,
@@ -164,7 +164,7 @@ export const FormControlMixin = dedupeMixin(
164164 * @see {@link this._registerFormElement }
165165 */
166166 _requestParentFormGroupUpdateOfResetModelValue ( ) {
167- requestAnimationFrame ( ( ) => {
167+ this . updateComplete . then ( ( ) => {
168168 if ( this . __parentFormGroup ) {
169169 this . __parentFormGroup . _updateResetModelValue ( ) ;
170170 }
Original file line number Diff line number Diff line change @@ -518,7 +518,8 @@ describe('<lion-fieldset>', () => {
518518 < lion-input id ="firstName " name ="firstName " .modelValue ="${ 'Foo' } "> </ lion-input >
519519 </ lion-fieldset >
520520 ` ) ;
521- await nextFrame ( ) ;
521+ await el . querySelector ( 'lion-input' ) . updateComplete ;
522+
522523 const input = el . querySelector ( '#firstName' ) ;
523524
524525 input . modelValue = 'Bar' ;
@@ -536,7 +537,8 @@ describe('<lion-fieldset>', () => {
536537 < lion-input id ="firstName " name ="firstName[] " .modelValue ="${ 'Foo' } "> </ lion-input >
537538 </ lion-fieldset >
538539 ` ) ;
539- await nextFrame ( ) ;
540+ await el . querySelector ( 'lion-input' ) . updateComplete ;
541+
540542 const input = el . querySelector ( '#firstName' ) ;
541543
542544 input . modelValue = 'Bar' ;
@@ -556,9 +558,11 @@ describe('<lion-fieldset>', () => {
556558 </ lion-fieldset >
557559 </ lion-fieldset >
558560 ` ) ;
559- // 2 times as we are nested here
560- await nextFrame ( ) ;
561- await nextFrame ( ) ;
561+ await Promise . all ( [
562+ el . querySelector ( 'lion-fieldset' ) . updateComplete ,
563+ el . querySelector ( 'lion-input' ) . updateComplete ,
564+ ] ) ;
565+
562566 const input = el . querySelector ( '#firstName' ) ;
563567 const nestedFieldset = el . querySelector ( '#name' ) ;
564568
You can’t perform that action at this time.
0 commit comments