Skip to content

Commit

Permalink
fix: combobox moving when there is an error
Browse files Browse the repository at this point in the history
  • Loading branch information
SebassNoob authored and vichannnnn committed Aug 26, 2023
1 parent 952b1ae commit 32cde79
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions holy-grail-frontend/src/components/Combobox/Combobox.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Autocomplete, AutocompleteProps, TextField } from '@mui/material';
import { Autocomplete, AutocompleteProps, TextField, Typography } from '@mui/material';
import { SyntheticEvent } from 'react';
import { CommonType } from '@api/library';

Expand Down Expand Up @@ -47,7 +47,16 @@ export const Combobox = ({
}
}}
renderInput={(params) => (
<TextField {...params} label={label} error={error} helperText={helperText} />
<TextField
{...params}
label={label}
error={error}
helperText={
<Typography sx={{ fontSize: '80%', position: 'absolute' }} noWrap>
{helperText}
</Typography>
}
/>
)}
isOptionEqualToValue={(option: string | CommonType, value: string | CommonType) =>
typeof option !== 'string' && typeof value !== 'string' ? option.id === value.id : false
Expand Down
2 changes: 1 addition & 1 deletion holy-grail-frontend/src/features/Upload/UploadNote.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
.note-combobox {
flex: 1 1 0;
width: 100%;
margin-bottom: 12px;
margin-bottom: 16px;
}


Expand Down

0 comments on commit 32cde79

Please sign in to comment.