@@ -184,6 +184,13 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
184184 onChange ( { ...values , controlPlaneMemoryGb : parseInt ( memory , 10 ) } ) ;
185185 } ;
186186
187+ /** Prevent mouse wheel from incrementing/decrementing focused number inputs */
188+ const handleNumberInputWheel = (
189+ event : React . WheelEvent < HTMLInputElement > ,
190+ ) : void => {
191+ event . currentTarget . blur ( ) ;
192+ } ;
193+
187194 const handleWorkloadNumberChange = (
188195 field : keyof WorkloadFormValues ,
189196 ) : ( ( _event : React . FormEvent < HTMLInputElement > , value : string ) => void ) => {
@@ -249,6 +256,7 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
249256 id = "total-vms"
250257 value = { workloadValues . totalVMs }
251258 onChange = { handleWorkloadNumberChange ( "totalVMs" ) }
259+ onWheel = { handleNumberInputWheel }
252260 name = "total-vms"
253261 aria-label = "Total VMs"
254262 type = "number"
@@ -274,6 +282,7 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
274282 id = "total-cpu"
275283 value = { workloadValues . totalCPU }
276284 onChange = { handleWorkloadNumberChange ( "totalCPU" ) }
285+ onWheel = { handleNumberInputWheel }
277286 name = "total-cpu"
278287 aria-label = "Total CPU"
279288 type = "number"
@@ -299,6 +308,7 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
299308 id = "total-memory"
300309 value = { workloadValues . totalMemory }
301310 onChange = { handleWorkloadNumberChange ( "totalMemory" ) }
311+ onWheel = { handleNumberInputWheel }
302312 name = "total-memory"
303313 aria-label = "Total memory"
304314 type = "number"
@@ -340,6 +350,7 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
340350 id = "smt-threads"
341351 value = { values . smtThreads }
342352 onChange = { handleSmtThreadsChange }
353+ onWheel = { handleNumberInputWheel }
343354 name = "smt-threads"
344355 aria-label = "SMT threads"
345356 isDisabled = { ! values . smtEnabled }
@@ -382,6 +393,7 @@ export const SizingInputForm: React.FC<SizingInputFormProps> = ({
382393 id = "smt-threads"
383394 value = { values . smtThreads }
384395 onChange = { handleSmtThreadsChange }
396+ onWheel = { handleNumberInputWheel }
385397 name = "smt-threads"
386398 aria-label = "SMT threads"
387399 isDisabled = { ! values . smtEnabled }
0 commit comments