File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -188,10 +188,6 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
188
188
// ======================= Focus ========================
189
189
const [ isFocused , setIsFocused ] = React . useState ( false ) ;
190
190
191
- const currentIndex = segmentedOptions . findIndex (
192
- ( option ) => option . value === rawValue ,
193
- ) ;
194
-
195
191
const handleFocus = ( ) => {
196
192
setIsFocused ( true ) ;
197
193
} ;
@@ -202,6 +198,10 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
202
198
203
199
// ======================= Keyboard ========================
204
200
const onOffset = ( offset : number ) => {
201
+ const currentIndex = segmentedOptions . findIndex (
202
+ ( option ) => option . value === rawValue ,
203
+ ) ;
204
+
205
205
const total = segmentedOptions . length ;
206
206
const nextIndex = ( currentIndex + offset + total ) % total ;
207
207
You can’t perform that action at this time.
0 commit comments