From 4d661abf9697999a234736e457542efe8ca61fae Mon Sep 17 00:00:00 2001 From: Sander Bruens Date: Mon, 2 Oct 2023 14:35:17 -0400 Subject: [PATCH] Reset the contact view when a user clicks the "back" button. --- src/www/ui_components/app-root.js | 5 +++++ src/www/views/contact_view/index.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/www/ui_components/app-root.js b/src/www/ui_components/app-root.js index c465fb11e49..ebbaf74df5e 100644 --- a/src/www/ui_components/app-root.js +++ b/src/www/ui_components/app-root.js @@ -801,6 +801,11 @@ export class AppRoot extends mixinBehaviors([AppLocalizeBehavior], PolymerElemen } _goBack() { + if (this.page == 'contact') { + // TODO: Replace with `this.$.contactView` once the element is no longer inside a `dom-if`. + this.shadowRoot.querySelector('#contactView').reset(); + } + // If there is a navigation on the webview's history stack, pop it off to go back. if (history.length > 1) { history.back(); diff --git a/src/www/views/contact_view/index.ts b/src/www/views/contact_view/index.ts index 50e348e2e19..9a51f4c8aed 100644 --- a/src/www/views/contact_view/index.ts +++ b/src/www/views/contact_view/index.ts @@ -161,7 +161,7 @@ export class ContactView extends LitElement { this.step = Step.FORM; } - private reset() { + reset() { this.isFormSubmitting = false; this.showIssueSelector = false; this.step = Step.ISSUE_WIZARD;