From 33c7e7b28c3166776cdfaea8f8f6c81694d4719f Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 17 Jun 2023 19:13:30 -0700 Subject: [PATCH] Add tabindex to DurationInput --- components/common/DurationInput/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/common/DurationInput/index.tsx b/components/common/DurationInput/index.tsx index 91513838..325af102 100644 --- a/components/common/DurationInput/index.tsx +++ b/components/common/DurationInput/index.tsx @@ -14,7 +14,10 @@ interface Props } const DurationInput = React.forwardRef( - function DurationInput({ className, value, onValueChange }, forwardedRef) { + function DurationInput( + { className, value, onValueChange, ...props }, + forwardedRef + ) { // State const [duration, setDuration] = useState('') const [minutesSelected, setMinutesSelected] = useState(false) @@ -191,6 +194,7 @@ const DurationInput = React.forwardRef( onKeyDown={handleKeyDown} placeholder="mm" size={3} + tabIndex={props.tabIndex} /> : ( onKeyDown={handleKeyDown} placeholder="ss" size={2} + tabIndex={props.tabIndex ? props.tabIndex + 1 : undefined} /> )