fix(field): fix form registration in Edge
This commit is contained in:
parent
98c7444569
commit
7e1a7ef95a
2 changed files with 11 additions and 7 deletions
|
|
@ -145,7 +145,7 @@ export const FormControlMixin = dedupeMixin(
|
|||
* will requires a `await nextFrame()` in tests
|
||||
*/
|
||||
_registerFormElement() {
|
||||
requestAnimationFrame(() => {
|
||||
this.updateComplete.then(() => {
|
||||
this.dispatchEvent(
|
||||
new CustomEvent('form-element-register', {
|
||||
detail: { element: this },
|
||||
|
|
@ -164,7 +164,7 @@ export const FormControlMixin = dedupeMixin(
|
|||
* @see {@link this._registerFormElement}
|
||||
*/
|
||||
_requestParentFormGroupUpdateOfResetModelValue() {
|
||||
requestAnimationFrame(() => {
|
||||
this.updateComplete.then(() => {
|
||||
if (this.__parentFormGroup) {
|
||||
this.__parentFormGroup._updateResetModelValue();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -518,7 +518,8 @@ describe('<lion-fieldset>', () => {
|
|||
<lion-input id="firstName" name="firstName" .modelValue="${'Foo'}"></lion-input>
|
||||
</lion-fieldset>
|
||||
`);
|
||||
await nextFrame();
|
||||
await el.querySelector('lion-input').updateComplete;
|
||||
|
||||
const input = el.querySelector('#firstName');
|
||||
|
||||
input.modelValue = 'Bar';
|
||||
|
|
@ -536,7 +537,8 @@ describe('<lion-fieldset>', () => {
|
|||
<lion-input id="firstName" name="firstName[]" .modelValue="${'Foo'}"></lion-input>
|
||||
</lion-fieldset>
|
||||
`);
|
||||
await nextFrame();
|
||||
await el.querySelector('lion-input').updateComplete;
|
||||
|
||||
const input = el.querySelector('#firstName');
|
||||
|
||||
input.modelValue = 'Bar';
|
||||
|
|
@ -556,9 +558,11 @@ describe('<lion-fieldset>', () => {
|
|||
</lion-fieldset>
|
||||
</lion-fieldset>
|
||||
`);
|
||||
// 2 times as we are nested here
|
||||
await nextFrame();
|
||||
await nextFrame();
|
||||
await Promise.all([
|
||||
el.querySelector('lion-fieldset').updateComplete,
|
||||
el.querySelector('lion-input').updateComplete,
|
||||
]);
|
||||
|
||||
const input = el.querySelector('#firstName');
|
||||
const nestedFieldset = el.querySelector('#name');
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue