chore(form-core): make testing form registration easier
This commit is contained in:
parent
355aabc02c
commit
d9d88b7f55
3 changed files with 11 additions and 0 deletions
|
|
@ -20,6 +20,7 @@
|
|||
"src",
|
||||
"test",
|
||||
"test-helpers",
|
||||
"test-suites",
|
||||
"translations",
|
||||
"types"
|
||||
],
|
||||
|
|
|
|||
|
|
@ -42,6 +42,14 @@ const FormRegisteringMixinImplementation = superclass =>
|
|||
|
||||
disconnectedCallback() {
|
||||
super.disconnectedCallback();
|
||||
this.__unregisterFormElement();
|
||||
}
|
||||
|
||||
/**
|
||||
* Putting this in a separate method makes testing easier
|
||||
* @private
|
||||
*/
|
||||
__unregisterFormElement() {
|
||||
if (this._parentFormGroup) {
|
||||
this._parentFormGroup.removeFormElement(/** @type {* & FormRegisteringHost} */ (this));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ export declare class FormRegisteringHost {
|
|||
* ChoiceGroup
|
||||
*/
|
||||
protected _parentFormGroup: FormRegistrarHost | undefined;
|
||||
|
||||
private __unregisterFormElement: void;
|
||||
}
|
||||
|
||||
export declare function FormRegisteringImplementation<T extends Constructor<LitElement>>(
|
||||
|
|
|
|||
Loading…
Reference in a new issue