Skip to content

Commit

Permalink
Merge pull request #38 from concord-consortium/186752905-filter-modal…
Browse files Browse the repository at this point in the history
…-fix

186752905 filter modal fix
  • Loading branch information
eireland authored Jan 29, 2024
2 parents 697ffc8 + 1a01416 commit d8ab2ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/components/attribute-filter.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ table tr:nth-child(even) {
box-sizing: border-box;

&.wide {
width: 217px;
width: 227px;
left: 114px;
}

Expand Down Expand Up @@ -208,7 +208,7 @@ table tr:nth-child(even) {
}

.filter-operator-selection-container {
width: 165px;
width: 180px;
max-height: 190px;
padding: 9px 12px 5px 9px;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.5);
Expand All @@ -226,6 +226,7 @@ table tr:nth-child(even) {
height: 176px;
outline: none;
box-sizing: border-box;
overflow: hidden;

option {
font-family: "Montserrat", sans-serif;
Expand Down
8 changes: 5 additions & 3 deletions src/components/attribute-filter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ const FilterModal = ({attr, position, targetFilterBottom, setShowFilterModal, se
},[dropdownBottom, showOperatorSelectionModal, windowHeight]);

const handleReset = () => {
setOperator(currentAttrFilter?.operator || "equals");
setShowFilterModal(false);
setOperator("equals");
if (filterValueInputElRef.current) {
filterValueInputElRef.current.value = "0";
}
};

const handleSubmitFilter = () => {
Expand Down Expand Up @@ -294,7 +296,7 @@ const FilterModal = ({attr, position, targetFilterBottom, setShowFilterModal, se
</input>;
} else {
return <input ref={filterValueInputElRef} key={`${operator}-${units}`} className="filter-value"
defaultValue={`${Array.isArray(currentFilterValue) ? currentFilterValue[0] : "100"} ${currentAttr?.unit[units]}`}>
defaultValue={`${Array.isArray(currentFilterValue) ? currentFilterValue[0] : "0"} ${currentAttr?.unit[units]}`}>
</input>;
}
};
Expand Down

0 comments on commit d8ab2ba

Please sign in to comment.