-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Force rerender on update/save #4396
Force rerender on update/save #4396
Conversation
src/panels/lovelace/hui-editor.ts
Outdated
@@ -152,6 +155,9 @@ class LovelaceFullConfigEditor extends LitElement { | |||
} else if (!this._changed && window.onbeforeunload) { | |||
window.onbeforeunload = null; | |||
} | |||
if (this._changed) { | |||
this.requestUpdate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need the requestUpdate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I tested this, that was the best I could come up with, that is now a few days ago, I can probably do something different now to handle it, I'll have a look after work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_changed
is a property, so if that is updated it should re-render?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should, yes.
does, not so much 🤷♂ (can be tested here https://demo.home-assistant.io/#/lovelace/0)
I can probably find a better way later today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a better way, looking at styles now
I think the disabled button needs a little styling, the text is very hard to read now. |
Changes
@property()
.Closes #4391
This also fixes an issue where the "Saved" and "Unsaved changes" were not showing.