Late addition: I had an inspiration about how to reduce the way
reactivity broke focus by, basically, removing the reactivity and managing the first-time-through lifecycle to prevent the update from causing refocus. It works well! Now I just need to test it.
This commit is contained in:
parent
356488809c
commit
2222f6722e
|
@ -17,14 +17,22 @@ export class ApplicationWizardPageBase extends CustomEmitterElement(AKElement) {
|
||||||
@query("form")
|
@query("form")
|
||||||
form!: HTMLFormElement;
|
form!: HTMLFormElement;
|
||||||
|
|
||||||
|
rendered = false;
|
||||||
|
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
@consume({ context: applicationWizardContext, subscribe: true })
|
@consume({ context: applicationWizardContext })
|
||||||
@state()
|
|
||||||
public wizard!: WizardState;
|
public wizard!: WizardState;
|
||||||
|
|
||||||
|
shouldUpdate(changedProperties: Map<string, any>) {
|
||||||
|
if (!this.rendered) {
|
||||||
|
this.rendered = true;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return (changedProperties.size !== 0)
|
||||||
|
}
|
||||||
|
|
||||||
dispatchWizardUpdate(update: Partial<WizardState>) {
|
dispatchWizardUpdate(update: Partial<WizardState>) {
|
||||||
// TODO: Incorporate this into the message heading upward: "the current step is valid."
|
// TODO: Incorporate this into the message heading upward: "the current step is valid."
|
||||||
console.log(this.form.reportValidity());
|
|
||||||
|
|
||||||
this.dispatchCustomEvent("ak-application-wizard-update", {
|
this.dispatchCustomEvent("ak-application-wizard-update", {
|
||||||
...this.wizard,
|
...this.wizard,
|
||||||
|
|
|
@ -30,7 +30,6 @@ export class ApplicationWizard extends CustomListenerElement(AKElement) {
|
||||||
* Providing a context at the root element
|
* Providing a context at the root element
|
||||||
*/
|
*/
|
||||||
@provide({ context: applicationWizardContext })
|
@provide({ context: applicationWizardContext })
|
||||||
@property({ attribute: false })
|
|
||||||
wizardState: WizardState = {
|
wizardState: WizardState = {
|
||||||
step: 0,
|
step: 0,
|
||||||
providerType: "",
|
providerType: "",
|
||||||
|
|
|
@ -31,7 +31,9 @@ export class ApplicationWizardApplicationDetails extends BasePanel {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
render(): TemplateResult {
|
render(): TemplateResult {
|
||||||
|
console.log("HUH?");
|
||||||
return html` <form class="pf-c-form pf-m-horizontal" @input=${this.handleChange}>
|
return html` <form class="pf-c-form pf-m-horizontal" @input=${this.handleChange}>
|
||||||
<ak-text-input
|
<ak-text-input
|
||||||
name="name"
|
name="name"
|
||||||
|
|
Reference in New Issue