Skip to content

Commit

Permalink
Fix filtering selected sidebar fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kertal committed Feb 18, 2021
1 parent 28fa873 commit 1ff4d20
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ export function groupFields(
}
// add columns, that are not part of the index pattern, to be removeable
for (const column of columns) {
if (!result.selected.find((field) => field.name === column)) {
result.selected.push({ name: column, displayName: column } as IndexPatternField);
const tmpField = { name: column, displayName: column } as IndexPatternField;
if (
!result.selected.find((field) => field.name === column) &&
isFieldFiltered(tmpField, fieldFilterState, fieldCounts)
) {
result.selected.push(tmpField);
}
}
result.selected.sort((a, b) => {
Expand Down

0 comments on commit 1ff4d20

Please sign in to comment.