-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sortBy): ensure a return value for getWidgetSearchParameters (#4126)
This PR ensures that the `sortBy` widget always return a value for `index` (or at least don't remove the current one). The call to `getWidgetSearchParameters` might happen once before the `init` step. The current implementation relies on the `init` step (`this.initialIndex`) when no value is found in the `uiState`. When the widget is not initialized the value set is `undefined` which means that it removes the current index. To avoid this problem we fall back on the current index when none of the conditions are met. It's the responsibility of the widget to set a value. It doesn't make sense to return `SearchParameters` without an index.
- Loading branch information
Showing
2 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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