Repository navigation
Conversation
This comment has been minimized.
This comment has been minimized.
gjulivan
force-pushed
the
datagrid/fix-filter-lazy-load
branch
from
November 6, 2026 08:40
c495a97 to
114dacb
Compare
Contributor
AI Code Review
What was reviewed
Skipped (out of scope): CI: pending: sigridci · unrelated failures: security/snyk (external scanner, 20 tests failed; the Snyk code and license checks passed) Findings
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Fixes WC-3635. With Use lazy load turned off, the Data Grid 2 drop-down filter (association mode) loaded only part of its options after the user returned to the page with Close page. If the selected option was not in that part, the clear button stayed visible but the caption was empty, and the filter was no longer applied to the grid.
Root cause
In
RefFilterStore:datasource.setLimit(100)in every mode, not only in lazy mode.ListValuelimit when the user returns to a page (documented onListValue.setLimit). The new store instance starts with an emptyselectedItems, and the non-lazysetup()calledloadMore(), which added 20 to the restored limit. That gives the 100–120 options from the report. A selected option outside that range has no loaded object, so it gets no caption and no filter condition.Changes
widget-plugin-dropdown-filter/RefFilterStore:setup()resets the limit to the default (no limit) withsetLimit(undefined)instead ofloadMore(), so a limit restored on page return is removed.RefFilterStore(the spec only had a placeholder before): limit handling in lazy and non-lazy mode, including a restored limit of 100, and the caption of a restored selection outside the first 100 options.Not in this PR
With lazy loading on, a selected option outside the loaded pages can still lose its caption after returning to the page. The property description already says value restoration is limited in that mode. Fixing it needs a separate fetch of the selected objects by ID.
What should be covered while testing?
Use a Data Grid 2 with a drop-down filter on an association column, Use lazy load = No, and more than 120 options (steps from WC-3635):
ZZAccountOutsideTop100).