Skip to content

fix: reset login overlay fields and disabled state on close - #12274

Merged
web-padawan merged 1 commit into
mainfrom
fix/login-overlay-reset-on-close
Jul 30, 2026
Merged

fix: reset login overlay fields and disabled state on close#12274
web-padawan merged 1 commit into
mainfrom
fix/login-overlay-reset-on-close

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Closing the login overlay is supposed to clear the username and password fields and re-enable the form, so that reopening it starts from a clean state. That has not worked since 25.0.0.

_openedChanged(opened, oldOpened) is called from updated() with a single argument, so oldOpened is always undefined and the whole reset branch is dead code. Before #9794 this was a Polymer observer (_onOpenedChange) that read this.opened directly and needed no previous value.

Reproduction

Using dev/login-overlay.html: type a username and a password, click Log in, then reopen the overlay. The old values are still there and the Log in button stays disabled. Measured right after closing:

{ opened: false, disabled: true, username: 'user', password: 'pass' }

Expected disabled: false and empty fields. This is why the dev page has to set login.disabled = false before reopening.

Changes

The previous value comes from the changed properties map, so the reset only runs on a real open → closed transition. Reading !opened instead would also run it on the first render and would reset disabled when it is set before the element is attached — initially closed > should not enable the submit button when disabled is set before attaching covers that.

Clearing the fields also applies when the element is removed from the DOM while open, which matches the behavior in 24.x.

Related to #12272


🤖 Generated with Claude Code

`_openedChanged` was called with a single argument, so `oldOpened` was
always `undefined` and the branch that clears the username and password
fields and re-enables the form never ran. Pass the previous value from
the changed properties map.

Regression since 25.0.0, where the Polymer `_onOpenedChange` observer was
replaced with a call from `updated()`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Nothing to flag — the changes look good.

@web-padawan
web-padawan merged commit 4cb7f3a into main Jul 30, 2026
15 checks passed
@web-padawan
web-padawan deleted the fix/login-overlay-reset-on-close branch July 30, 2026 11:16
web-padawan added a commit that referenced this pull request Jul 30, 2026
…12282)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
web-padawan added a commit that referenced this pull request Jul 30, 2026
…12281)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.3.0-alpha8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants