-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Fixed to show spinner on data load #1491
Conversation
Also fixed the issue where, when showing the spinner, the iron-collapse does not always open. Note that this collapse bug did exist in version 1,10 too,
@@ -120,7 +119,8 @@ export const DataLoaderBehavior = { | |||
|
|||
if (!this.isAttached) return; | |||
this._loadDataAsync = this.async(() => { | |||
this.dataLoading = true; | |||
// Using a setter does not notify the impl observers. |
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.
Hmm, this is basically the same issue as the loadKey issue, right? So it seems like maybe the behavior observer/property connection is buggy or broken somehow.
@@ -140,7 +140,7 @@ export const DataLoaderBehavior = { | |||
}); | |||
|
|||
return Promise.all(promises).then(this._canceller.cancellable(result => { | |||
this.dataLoading = false; | |||
this.set('dataLoading', false); |
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.
Can you add the same comment here?
@@ -58,7 +58,6 @@ export const DataLoaderBehavior = { | |||
|
|||
dataLoading: { | |||
type: Boolean, | |||
readOnly: true, |
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.
Does this have to be non-readOnly in order to use set()? It's still logically readonly though, right?
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.
Ah, you were correct! I always forget that you ned to use a special setter when setting a value to a readOnly property. I changed other codes to use this._setDataLoading
and kept this readOnly. Thanks!
Also fixed the issue where, when showing the spinner, the iron-collapse
does not always open. Note that this collapse bug did exist in version
1,10 too,