-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Clicking on a sortable table column header not working (not sort) when 'sortable' value is dynamic #5520
Comments
Looks like if there's is no sortable field when the table is mounted, it wont be sortable, even if changed dynamically as you're doing. A workaround could be to add |
Thanks for your answer. |
I noticed a similar issue in my own scenario, where the fields are loaded asynchronously, and therefor the 'sortable' property was only true after loading. I could not reproduce it in the playground, but what happened is that some events are rebound after 'sortable' changes, causing each header click to trigger 2 (or more) 'sorting' events. The two events cancel each-other out, first sorting descending, then again ascending, so in the end the column stays as it was. The two mentioned workarounds worked:
|
Describe the bug
Clicking on a sortable table column header not working (not sort) when 'sortable' value is dynamic.
Like example below when default fields no sortable or sortable is false, then switch
enableSortAble
to true, column header is changed (there are arrow sort icon) but clicking the header column is not sorting the column.Steps to reproduce the bug
Expected behavior
When click switch button to enable sortable, then clicking on a sortable column header will sort the column.
Versions
Libraries:
Environment:
Demo link
https://codesandbox.io/s/bvtable-sortable-g6lyz-g6lyz?file=/App.vue
The text was updated successfully, but these errors were encountered: