Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dialogs/generic/dialog-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class DialogBox extends LitElement {
dialogInitialFocus
.value=${this._value || ""}
@keyup=${this._handleKeyUp}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This handler is doing nothing because mwc-dialog hits the primary confirm button on enter key down, not up. The bug occurs because the confirm method then gets called before this._value is updated (because the change event only fires when focus is removed).

@change=${this._valueChanged}
@input=${this._valueChanged}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a good fix because it's just unnecessarily updating the state variable every time an input character is changed, and probably causing the lit element to keep rescheduling render updates.

.label=${this._params.inputLabel
? this._params.inputLabel
: ""}
Expand Down