-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
fix(table): fix filtered event, fix emptyFilter message w/filter function, fix reactivity of filter sub routines (Fixes #1989,#1517) #2149
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
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #2149 +/- ##
=========================================
+ Coverage 65.04% 65.4% +0.35%
=========================================
Files 159 159
Lines 2958 3000 +42
Branches 812 834 +22
=========================================
+ Hits 1924 1962 +38
- Misses 748 751 +3
- Partials 286 287 +1
Continue to review full report at Codecov.
|
filtered event check moved to the filteredItems() method. Filtered event is now emitted after the table has updated (via $nextTick). Improves run-time memory footprint by not maintaining a separate copy of the filtered data.
Handles case where filter is a function and `empty` message instead of `emptyFiltered` message was showing when filtered items was 0 length array.
Trying to fix a race condition with pagination when filtered
Just needs a few documentation tweaks before merge |
filtering, sorting and pagination are now fully reactive via computed props, fixing what was broken via #1893 (using methods when computedProps should have been used) |
To prevent undefined values from creeping in
When the fields's label was set to a blank string, this left non-sighted users at a disadvantage as to what the column is about. This adds the field's key (humanized) to the `aria-label` to provides hint to non-sighted users. Alternatively if a field title is provided, then the aria-label is not altered. Addresses ARIA issues introduced by PR #1587
Additional separate PRs will be created for adding:
|
Description of PR:
Adds additional checks to see if the filtered rows have actually changed.
Also prevents the filtered event from firing on the initial render of the table.
Previously,
b-table
was only looking at changes in length of the filtered rows. The new added checks (looseEqual check andfilter
prop check) help ensure proper reactivity and proper displaying of theempty-filtered-text
with user supplied filter functionsFixes #1989
Fixes #1517
Undoes #1893 which broke efficient reactivity for filtering, sorting and paging (it was using non-reactive methods when computedProps should have been used for efficient caching)
Fixes ARIA issue introduced by PR #1587
PR checklist:
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
For filtering using an external filter function, users should use the
filter-function
instead of settingfilter
to a function.The external filter function (if provided) will also receive a copy of the
filter
prop as the second argument (the first argument remains the same, which is the record being inspected).it is still possible to set
filtered
to a filter function (as long asfilter-function
is left null), but it is discouraged (deprecated), as it was not overly reactive to changes (i.e. requiring a forced refresh of the table to apply the changes, or passing a new function ref tofilter
.The new way allows the user to pass a string, object or array to
filter
to perform more complex filtering, and allows the filter function to be reactive to changes in thefilter
prop.The PR fulfills these requirements:
dev
branch, not themaster
branchfixes #xxxx[,#xxxx]
, where "xxxx" is the issue number)If new features/enhancement/fixes are added or changed:
If adding a new feature, or changing the functionality of an existing feature, the PR's description includes:
PR titles should following the Conventional Commits naming convention