Skip to content

Commit f12a903

Browse files
committed
chore: adjust code style
1 parent fbd0d56 commit f12a903

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
188188
// ======================= Focus ========================
189189
const [isFocused, setIsFocused] = React.useState(false);
190190

191-
const currentIndex = segmentedOptions.findIndex(
192-
(option) => option.value === rawValue,
193-
);
194-
195191
const handleFocus = () => {
196192
setIsFocused(true);
197193
};
@@ -202,6 +198,10 @@ const Segmented = React.forwardRef<HTMLDivElement, SegmentedProps>(
202198

203199
// ======================= Keyboard ========================
204200
const onOffset = (offset: number) => {
201+
const currentIndex = segmentedOptions.findIndex(
202+
(option) => option.value === rawValue,
203+
);
204+
205205
const total = segmentedOptions.length;
206206
const nextIndex = (currentIndex + offset + total) % total;
207207

0 commit comments

Comments
 (0)