Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 503cc12

Browse files
committed
fix(search-box): fix for alignment of clear button
Fix for the vertical alignment of the clear buttons at search inputs. Add the missing clear/reset button for the AddToGroupModal.
1 parent 0989a97 commit 503cc12

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

client/src/components/AddToGroupModal/index.jsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,10 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
155155
setCreatingGroup(false);
156156
};
157157

158+
const reset = () => {
159+
setFilter("");
160+
};
161+
158162
return (
159163
<Modal
160164
onCancel={onCancel}
@@ -175,6 +179,16 @@ export default function AddToGroupModal({ onCancel, updateUser, user }) {
175179
value={filter}
176180
disabled={loadingGroups}
177181
/>
182+
<span
183+
className={
184+
filter.length > 0
185+
? `${style.resetKeyword}`
186+
: `${style.resetKeyword} ${style.resetKeywordHidden}`
187+
}
188+
onClick={() => reset()}
189+
>
190+
&times;
191+
</span>
178192
<Button
179193
className={style.createButton}
180194
onClick={createGroup}

client/src/components/AddToGroupModal/style.module.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@
6363
&::placeholder {
6464
opacity: 0.5;
6565
}
66+
67+
&::-ms-clear {
68+
display: none;
69+
height: 0;
70+
width: 0;
71+
}
6672
}
6773

6874
.searchRow {
@@ -92,3 +98,24 @@
9298
font: 400 12pt/1.25 Inter;
9399
margin-left: 30px;
94100
}
101+
102+
.resetKeyword {
103+
position: absolute;
104+
left: 67.5%;
105+
top: 10px;
106+
appearance: none;
107+
border: none;
108+
color: $textColor;
109+
cursor: pointer;
110+
font-size: 24px;
111+
font-family: Arial;
112+
outline: none;
113+
114+
&:hover {
115+
color: $red;
116+
}
117+
118+
&.resetKeywordHidden {
119+
visibility: hidden;
120+
}
121+
}

client/src/components/SuggestionBox/style.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,21 @@
9797
height: 20px;
9898
}
9999

100+
// firefox solution to vertically align .resetKeyword
101+
@supports (-moz-appearance: none) {
102+
.resetKeyword {
103+
align-self: center;
104+
}
105+
}
106+
100107
.resetKeyword {
101108
order: 2;
102109
appearance: none;
103110
border: none;
104111
color: $textColor;
105112
cursor: pointer;
106113
font-size: 24px;
114+
font-family: Arial;
107115
outline: none;
108116

109117
&:hover {

client/src/components/searchBox/searchBox.module.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,21 @@
6161
outline: none;
6262
}
6363

64+
// firefox solution to vertically align .resetKeyword
65+
@supports (-moz-appearance: none) {
66+
.resetKeyword {
67+
align-self: center;
68+
}
69+
}
70+
6471
.resetKeyword {
6572
order: 2;
6673
appearance: none;
6774
border: none;
6875
color: $textColor;
6976
cursor: pointer;
7077
font-size: 24px;
78+
font-family: Arial;
7179
outline: none;
7280

7381
&:hover {

0 commit comments

Comments
 (0)