Skip to content

Commit

Permalink
Merge pull request #133 from wmde/june22-organization-filter-tag-pill
Browse files Browse the repository at this point in the history
Make organization filter a tag selection
  • Loading branch information
manicki authored Jul 6, 2022
2 parents 9338ae1 + 36b065e commit 44e883a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ exports[`Filter renders correctly 1`] = `
Organization
</label>
<Select
allowClear={true}
filterOption={[Function]}
id="organization"
mode="tags"
onChange={[Function]}
optionFilterProp="children"
placeholder="Any Organization"
Expand Down
9 changes: 7 additions & 2 deletions packages/client/src/components/filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,18 @@ const Filter: React.FC<FilterProps> = ({ filters, onFilterChange }) => {
<div className="filter-element">
<label htmlFor="organization">Organization</label>
<Select
allowClear
mode="tags"
style={{ width: 240 }}
showSearch
placeholder="Any Organization"
value={filters.organization}
optionFilterProp="children"
onChange={(val) => onFilterChange("organization", val)}
onChange={(val) => {
if (Array.isArray(val)) {
val = val.pop();
}
onFilterChange("organization", val);
}}
filterOption={(input, option) =>
option!.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
}
Expand Down

0 comments on commit 44e883a

Please sign in to comment.