-
Notifications
You must be signed in to change notification settings - Fork 174
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
Table Column Visibility Not Updating When Visible Is Changed #876
Comments
@daleshort Thanks for pointing out this bug. When I added the However, it is not as simple as just removing the If you remove Add this to any
|
In that case I updated the PR with a more narrow approach. |
(and tested it with ThAttrs and tdAttrs) |
I admit this is a problem, but I would like to fix it in such a way that all or atleast all of the function props become reactive again. But I don't know how... (without setting all props one by one in the computed function) |
I actually can't reproduce the infinite update error. Here is why I'm doing to try and reproduce the issue with spreading just props. Firefox 124.0.1 in TableColumn
});` in Table detail example:
I was hoping to see if I could find another way. I understand where you're coming from but in the absence of a more elegant solution, and given this is breaking your own examples (and in our production code), I'd strongly vote for the pragmatic fix of listing the props that can be reactive in the computed. It can always be improved later, and it's not like the props aren't already explicitly enumerated in the props declaration 10 lines above or somehow a naive user could introduce a new prop that wouldn't be listed in the computed. |
You have to set the thAttrs and tdAttrs to a I confirm your point, and the pragmatic fix will be introduced in the next release, which came in the near future. |
ah sorry. Thanks for bearing with me. I can reproduce it now. I tried some stuff but nothing worked nor am I an expert in the advanced reactivity features. Thanks for your consideration. |
Not for the fix, but for 0.9, I consider moving thAttrs and tdAttrs as property to o-table, then the problem could be solved, and |
Overview of the problem
Toggling visible on table columns does not cause the table column to hide.
Oruga version: 0.8.6
Vuejs version: 3.4.21
OS/Browser: Firefox/Chrome
Description
When the visible property of the table columns is reactive, and changed between true and false the columns do not hide.
Static values of true or false do control the column visibility successfully. It seems this works in Vue 3.2.41 but does not work in 3.4.21 and may be related to rerender efficiency improvements in Vue. Specifically this line spreads the props using the toRaw function which breaks the reactivity of the props. Removing the toRaw and just spreading props as-is fixes the bug.
Steps to reproduce
Expected behavior
Table columns to hide when visibility prop is programmatically toggled to false
Actual behavior
Column visibility always maintains the initial state of the visibility prop.
The text was updated successfully, but these errors were encountered: