-
-
Notifications
You must be signed in to change notification settings - Fork 177
Reactive blocks drawer hidden icon #7118
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
base: develop-minor
Are you sure you want to change the base?
Conversation
], | ||
methods: { | ||
show() { | ||
this.hidden = 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.
Don't you get console errors with this? Usually Vue is strictly against directly mutating props.
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, no 🤷♂️
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.
I'm not expert about that but I think you're right. I have updated as your idea anyway.
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.
I think we should update the drawer props instead:
this.$panel.drawer.props.hidden = 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.
I think my last change that Nico's idea is better :)
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.
@afbora I wouldn't create a new data entry. It introduces just another place this needs to be updated, another place that could be false later. Better to have a single place of truth (the prop).
@bastianallgeier I also don't think directly updating the drawer prop is the best idea. We should find out why emitting the event isn't working - or why it is working but the drawer props aren't reactively updating. I think that's the actual bug.
As I think about it, it's probably the same issue as #6301
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.
@distantnative I looked into it a bit. The problem seemed simple but I guess it's more difficult than I expected. Feel free to close the PR
After digging into Vue’s reactivity system, I realized that props are one-way bindings. So far IMHO this PR changes seems make sense :) |
We can also add a watch to the hidden prop in watch: {
hidden(value) {
this.isHidden = value;
}
} |
Have you tried if that works? My understanding is rather that Vue props indeed are reactive. But the problem is that we lose reactivity when opening a dialog or drawer down in I really think it's the same problem as #6301 |
Fixes
Breaking changes
None
Docs
Ready?
For review team