Skip to content

Commit d3ae0dd

Browse files
committed
Aesthetic fixes to FilterForm
1 parent 5c3e57b commit d3ae0dd

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

jbrowse/src/client/JBrowse/VariantSearch/components/FilterForm.tsx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export declare type FilterFormProps = {
2323
}
2424

2525
const FormControlMinWidth = styled(FormControl)(({ theme }) => ({
26-
minWidth: 200,
26+
width: 200,
2727
marginRight: theme.spacing(2)
2828
}))
2929

@@ -59,10 +59,7 @@ const CardActionsCenteredContent = styled(CardActions)(({ theme }) => ({
5959
display: "flex",
6060
flexDirection: "column",
6161
justifyContent: "flex-start",
62-
alignItems: "center",
63-
"& > :not(:first-child)": {
64-
textAlign: "center",
65-
}
62+
alignItems: "center"
6663
}))
6764

6865
const FormScroll = styled('div')(({ theme }) => ({
@@ -218,6 +215,7 @@ const FilterForm = (props: FilterFormProps ) => {
218215
<InputLabel id="field-label">Field</InputLabel>
219216
<Select
220217
labelId="field-label"
218+
label = 'Field'
221219
value={filter.field}
222220
onChange={(event) =>
223221
handleFilterChange(index, "field", event.target.value)
@@ -238,6 +236,7 @@ const FilterForm = (props: FilterFormProps ) => {
238236
<InputLabel id="operator-label">Operator</InputLabel>
239237
<Select
240238
labelId="operator-label"
239+
label="Operator"
241240
value={filter.operator}
242241
onChange={(event) =>
243242
handleFilterChange(index, "operator", event.target.value)
@@ -265,6 +264,7 @@ const FilterForm = (props: FilterFormProps ) => {
265264
<InputLabel id="value-select-label">Value</InputLabel>
266265
<Select
267266
labelId="value-select-label"
267+
label="Value"
268268
id={`value-select-${index}`}
269269
value={filter.value}
270270
onChange={(event) =>
@@ -282,11 +282,13 @@ const FilterForm = (props: FilterFormProps ) => {
282282
id={`value-select-${index}`}
283283
inputId={`value-select-${index}`}
284284
aria-labelledby={`value-select-${index}`}
285+
noOptionsMessage={() => 'Type to search...'}
285286
menuPortalTarget={document.body}
286287
menuPosition={'fixed'}
287288
isDisabled={filter.operator === "is empty" || filter.operator === "is not empty"}
288289
menuShouldBlockScroll={true}
289-
styles={{menuPortal: base => ({...base, zIndex: 9999})}}
290+
// See here: https://stackoverflow.com/questions/77625507/my-react-project-with-react-18-2-0-version-and-react-select-5-4-0-v
291+
styles={{ menuPortal: (base: any) => ({ ...base, zIndex: 9999 }) }}
290292
isMulti={fieldTypeInfo.find(obj => obj.name === filter.field)?.isMultiValued}
291293
defaultOptions={fieldTypeInfo.find(obj => obj.name === filter.field)?.allowableValues?.length < 20}
292294
loadOptions={(inputValue, callback) => {
@@ -307,6 +309,7 @@ const FilterForm = (props: FilterFormProps ) => {
307309
<InputLabel id="value-select-label">Value</InputLabel>
308310
<Select
309311
labelId="value-select-label"
312+
label="Value"
310313
id={`value-select-${index}`}
311314
value={filter.value}
312315
disabled={filter.operator === "is empty" || filter.operator === "is not empty"}
@@ -326,6 +329,7 @@ const FilterForm = (props: FilterFormProps ) => {
326329
label="Value"
327330
id={`value-select-${index}`}
328331
sx={ highlightedInputs[index]?.value ? highlightedSx : null }
332+
variant="outlined"
329333
value={filter.value}
330334
disabled={filter.operator === "is empty" || filter.operator === "is not empty"}
331335
onChange={(event) =>

0 commit comments

Comments
 (0)