Skip to content

Commit

Permalink
Fix Currency select label
Browse files Browse the repository at this point in the history
  • Loading branch information
aleksandr-kiliushin committed Nov 10, 2023
1 parent e189696 commit afabc6e
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/views/boards/BoardRecords/RecordFormDialog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,7 @@ export const RecordFormDialog: FC<TRecordFormDialogProps> = ({ record }) => {
type="number"
/>
<FormControl fullWidth>
<InputLabel>Currency</InputLabel>
<Select
{...register(FieldName.CurrencySlug)}
label="Currency"
value={watch(FieldName.CurrencySlug)} // Initial value is not set up without this prop passed explicitly. But should not it be passwed as part of {...register()}?
>
<Select {...register(FieldName.CurrencySlug)} value={watch(FieldName.CurrencySlug)}>
{currencies?.map((currency) => (
<MenuItem key={currency.slug} value={currency.slug}>
{currency.name} {currency.symbol}
Expand Down Expand Up @@ -195,10 +190,7 @@ export const RecordFormDialog: FC<TRecordFormDialogProps> = ({ record }) => {
</Select>
</FormControl>
<TextField {...register(FieldName.Date, { required: true })} label="Date" type="date" />
<Box sx={{ display: "grid" }}>
<label htmlFor={FieldName.Comment}>Comment</label>
<textarea {...register(FieldName.Comment)} />
</Box>
<TextField {...register(FieldName.Comment)} label="Comment" />
</RowGroup>
</form>
</Dialog.Body>
Expand Down

0 comments on commit afabc6e

Please sign in to comment.