-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
chore(table): break out code into helper modules and add additional tests #2805
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 #2805 +/- ##
==========================================
+ Coverage 76.93% 80.99% +4.06%
==========================================
Files 174 194 +20
Lines 3173 3199 +26
Branches 939 941 +2
==========================================
+ Hits 2441 2591 +150
+ Misses 532 441 -91
+ Partials 200 167 -33
Continue to review full report at Codecov.
|
commenting |
Hmmm... but user select disables the ability to select text. Maybe this class should only be applied if there is at least one row selected first? and removed when no rows are selected? |
Yes, it is the desired behavior of user-select. |
@lianee maybe a new class should be added to computed: {
isSelecting() {
return this.selectable &&
this.selectMode === 'range' &&
this.selectedRows &&
this.selectedRows.some(v => v)
}
} And if |
I guess the 2 classes (selecting and mode) should be added, making it more versatile, then users could override the default behavior just with CSS. |
@tmorehouse You were too fast for me ;) |
We could stilldo so.ethjng similar forthe other two modes (adding classes when section is active).. just no user-select none. And maybe add classes to say which mode is in use. |
I don't know how to suggest changes to your PR, but what I was thinking is:
mixin-selectable.js:
_table.scss:
leaving the user the choice to apply user-select in any mode he wants, whether or not there is a selection in process. But as I said, your solution works ok, range mode is now working as it should. |
Could you put this as a comment on the new PR? I can add it in later today. |
Description of Pull Request:
Breaking out helper functions into modules to make
<b-table>
a bit easier to maintain, and test individual helper functionality.Also always adds ARIA roles to all elements rendered (not just in stacked mode), in case user overrides CSS semantics (i.e. via
display: grid
).TO DO (in a future PR):
PR checklist:
What kind of change does this PR introduce? (check at least one)
Does this PR introduce a breaking change? (check one)
If yes, please describe the impact:
The PR fulfills these requirements:
dev
branch, not themaster
branchfixes #xxxx[,#xxxx]
, where "xxxx" is the issue number)and adding a new feature, break them into separate PRs if at all possible.
Conventional Commits naming convention (i.e.
"fix(alert): not alerting during SSR render", "docs(badge): Updated pill examples, fix typos",
"chore: fix typo in docs", etc). This is very important, as the
CHANGELOG
is generatedfrom these messages.
If new features/enhancement/fixes are added or changed:
package.json
for slot andevent changes)
keyboard only users? clickable items should be in the tab index, etc)
If adding a new feature, or changing the functionality of an existing feature, the PR's
description above includes:
suggestion issue first and wait for approval before working on it)