Skip to content

Commit

Permalink
Fix DateField and DateRangeField width multiple (#1432)
Browse files Browse the repository at this point in the history
  • Loading branch information
takurinton committed Sep 25, 2023
1 parent 73d1cfc commit 04af46d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/healthy-queens-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ingred-ui": patch
---

fix width multiple
2 changes: 1 addition & 1 deletion src/components/DateField/DateField/DateField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DateField = forwardRef<HTMLInputElement, DateFieldProps>(
propRef,
) {
const theme = useTheme();
const width = useMemo(() => `${getInputWidth(format) * 10}px`, [format]);
const width = useMemo(() => `${getInputWidth(format) * 9}px`, [format]);
const { ref: inputRef, ...props } = useDateField({ format, ...rest });
const ref = useMergeRefs<HTMLInputElement>(propRef, inputRef);

Expand Down
2 changes: 1 addition & 1 deletion src/components/DateField/DateRangeField/DateRangeField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const DateRangeField = forwardRef<HTMLInputElement, DateRangeFieldProps>(
propRef,
) {
const theme = useTheme();
const width = useMemo(() => `${getInputWidth(format) * 10}px`, [format]);
const width = useMemo(() => `${getInputWidth(format) * 9}px`, [format]);

const handleChange = (t: ClickStateType) => (date: Dayjs) => {
const { startDate, endDate } = rest.date;
Expand Down

0 comments on commit 04af46d

Please sign in to comment.