perf(table): minor tweaks to primary key usage #2741
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Pull Request:
Minor adjustments to row
:key
generation based on primary key existence.Rather than use a serialized version of the row values as the rows
:key
value, the displayed row index value is used (unless a primary key is provided).Users who are experiencing issues with components in cells getting re-used (and not fully updating, as in #931, and #2410) will need to specify a
primary-key
column to circumvent issues they may encounter. This PR partially reverts #2416 as using theprimary-key
will provide better results, as the serialized string (from the rows values) could change due to mutations in row data, causing unnecessary re-renders.Also adds a row attribute
data-pk
which will have the primary key value.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:
Partial impact to users that may experience issues with components/elements being re-used when filtering/sorting/pagination. Providing a
primary-key
in the table data (or using keys on their components) will circumvent the issues.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)