From 0a8201a6ec3ba0cfe4ad83b7530ce004b2ec4688 Mon Sep 17 00:00:00 2001 From: iryna Date: Thu, 27 Aug 2026 10:13:52 +0300 Subject: [PATCH 1/3] fix(decimal): default to decimal input mode --- src/components/decimal/decimal.component.tsx | 2 ++ src/components/decimal/decimal.test.tsx | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/components/decimal/decimal.component.tsx b/src/components/decimal/decimal.component.tsx index df3482039b..677d3cadc6 100644 --- a/src/components/decimal/decimal.component.tsx +++ b/src/components/decimal/decimal.component.tsx @@ -83,6 +83,7 @@ export const Decimal = React.forwardRef( allowEmptyValue = false, fieldHelp, id, + inputMode = "decimal", inputWidth, labelHelp, locale, @@ -325,6 +326,7 @@ export const Decimal = React.forwardRef( value={stateValue} data-component="decimal" id={id} + inputMode={inputMode} ref={ref} prefix={prefix} fieldHelp={fieldHelp} diff --git a/src/components/decimal/decimal.test.tsx b/src/components/decimal/decimal.test.tsx index e0132297ff..4cba4e4b7d 100644 --- a/src/components/decimal/decimal.test.tsx +++ b/src/components/decimal/decimal.test.tsx @@ -48,6 +48,16 @@ it.each([ expect(screen.getByTestId("hidden-input")).toHaveValue(formattedValue); }); +it("uses a decimal input mode by default and allows an explicit override", () => { + const { rerender } = render(); + + expect(screen.getByRole("textbox")).toHaveAttribute("inputmode", "decimal"); + + rerender(); + + expect(screen.getByRole("textbox")).toHaveAttribute("inputmode", "numeric"); +}); + it("does not fire onChange when the input blurs with no change in value", async () => { const user = userEvent.setup(); const onChange = jest.fn(); From e57ef5fc1df2ccdfe8ba86c3e1c178935365b710 Mon Sep 17 00:00:00 2001 From: iryna Date: Thu, 27 Aug 2026 10:19:31 +0300 Subject: [PATCH 2/3] fix(time): add numeric input mode hints --- src/components/time/time.component.tsx | 2 ++ src/components/time/time.test.tsx | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/components/time/time.component.tsx b/src/components/time/time.component.tsx index a906fff8dc..4a6d92c2d0 100644 --- a/src/components/time/time.component.tsx +++ b/src/components/time/time.component.tsx @@ -339,6 +339,7 @@ const Time = React.forwardRef( data-component="hours" ref={hoursRef} value={hourValue} + inputMode="numeric" onChange={(ev) => handleChange(ev, "hrs")} onBlur={handleBlur} id={internalHrsId.current} @@ -378,6 +379,7 @@ const Time = React.forwardRef( data-component="minutes" ref={minsRef} value={minuteValue} + inputMode="numeric" onChange={(ev) => handleChange(ev, "mins")} onBlur={handleBlur} id={internalMinsId.current} diff --git a/src/components/time/time.test.tsx b/src/components/time/time.test.tsx index eb8507cc86..66e78ad95d 100644 --- a/src/components/time/time.test.tsx +++ b/src/components/time/time.test.tsx @@ -319,6 +319,19 @@ test("should apply the custom id on the minutes input when `minutesInputProps` h expect(minutesInput).toHaveAttribute("id", "foo"); }); +test("should apply numeric input mode hints to the hours and minutes inputs", () => { + render(