mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
fix(select): select component sort functionality on certain options (#17638)
* fix: Select component sort function sorting by label instead of value on numbers * fix: change select component default sorting to sort by the initial index rather than a property like value or label * fix: select sorting add sortOptions to select components using sortByProperty * fix: change select component back, add order to options coming in from SelectControl * fix: select component options intitial sort bug * fix: add test cases for select fix Co-authored-by: Corbin Robb <corbin@Corbins-MacBook-Pro.local>
This commit is contained in:
@@ -116,6 +116,8 @@ const all_columns: typeof sharedControls.groupby = {
|
||||
? [t('must have a value')]
|
||||
: [],
|
||||
}),
|
||||
sortComparator: (a: { label: string }, b: { label: string }) =>
|
||||
a.label.localeCompare(b.label),
|
||||
visibility: isRawMode,
|
||||
};
|
||||
|
||||
@@ -276,6 +278,8 @@ const config: ControlPanelConfig = {
|
||||
choices: datasource?.order_by_choices || [],
|
||||
}),
|
||||
visibility: isRawMode,
|
||||
sortComparator: (a: { label: string }, b: { label: string }) =>
|
||||
a.label.localeCompare(b.label),
|
||||
},
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user