From 30e1c0b0a901caec0dc83ee8d6bf6072050245af Mon Sep 17 00:00:00 2001 From: LucasDLTG Date: Sun, 13 Sep 2026 09:08:42 +0200 Subject: [PATCH] feat: wheel behaviour on choiceselect --- src/components/ChoiceSelect/ChoiceSelect.tsx | 27 +++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/ChoiceSelect/ChoiceSelect.tsx b/src/components/ChoiceSelect/ChoiceSelect.tsx index 4722442..18f6b1a 100644 --- a/src/components/ChoiceSelect/ChoiceSelect.tsx +++ b/src/components/ChoiceSelect/ChoiceSelect.tsx @@ -23,8 +23,22 @@ function ChoiceSelect({ className = '', style, }: ChoiceSelectProps) { + const step = (direction: 1 | -1) => { + const currentIndex = options.indexOf(value); + + if (currentIndex === -1 || options.length === 0) return; + + const nextIndex = + (currentIndex + direction + options.length) % options.length; + + onChange(options[nextIndex]); + }; + return ( -
+