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
Handle dynamically adding sortable fields after table render (fixes #5520) #5521
Conversation
This pull request is being automatically deployed with Vercel (learn more). |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 2c1c48e:
|
Codecov Report
@@ Coverage Diff @@
## dev #5521 +/- ##
===========================================
- Coverage 100.00% 99.98% -0.02%
===========================================
Files 278 278
Lines 9409 9411 +2
Branches 2514 2514
===========================================
+ Hits 9409 9410 +1
- Misses 0 1 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hi @Hiws
like key: key+isSortable |
That looks to work as well. Will keep looking to see if i can find the actual issue |
After looking into it a bit more, it looks like the changes made in this #4825 PR, broke it. Changing this line back to bootstrap-vue/src/components/table/td.js Line 197 in e4d271a
Which, based on my guess means there's something wrong with the cache mixin However, i can't figure out how to fix it. |
Yeah, I noticed that the Further investigations are always welcome :) |
Gonna close this for now as i can't find a good solution. |
Describe the PR
Fixes the issue where dynamically adding a sortable field after the table has been mounted wouldn't be sorting on click.
It appears that if the handlers aren't present when mounted the first time, they can't be added later on a re-render. Even if they're present in the render data.
I personally don't think this is a proper solution, but I'm opening the PR to welcome discussion about a better one.
Before: https://codesandbox.io/s/bvtable-sortable-g6lyz-18rid?file=/App.vue
After: https://codesandbox.io/s/bvtable-sortable-g6lyz-m5q52?file=/App.vue
Closes: #5520
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)
, requires a patch version updatefeat(...)
, requires a minor version updatefeat(...)
, requires a minor version updatefix(...)
, requires a patch or minor version updatechore(docs)
, requires a patch version updateDoes this PR introduce a breaking change? (check one)
The PR fulfills these requirements:
dev
branch, not themaster
branch[...] (fixes #xxx[,#xxx])
, where "xxx" is the issue number)fix(alert): not alerting during SSR render
,docs(badge): update pill examples
,chore(docs): fix typo in README
, etc). This is very important, as theCHANGELOG
is generated from these messages, and determines the next version type (patch or minor).If new features/enhancement/fixes are added or changed: