diff --git a/src/components/inputs/accent-range.tsx b/src/components/inputs/accent-range.tsx index 15fa1084..b0bbb2d2 100644 --- a/src/components/inputs/accent-range.tsx +++ b/src/components/inputs/accent-range.tsx @@ -1,8 +1,11 @@ -import React from 'react'; +import React, {useState} from 'react'; import styled from 'styled-components'; +import {NumberInput} from 'src/components/panes/configure-panes/submenus/macros/keycode-sequence-components'; const Container = styled.span` - display: inline-block; + display: flex; + gap: 10px; + align-items: space-between; line-height: initial; width: 200px; `; @@ -16,13 +19,21 @@ export const AccentRange: React.FC< Omit, 'onChange'> & { onChange: (x: number) => void; } -> = (props) => ( - - ) => { - props.onChange && props.onChange(+e.target.value); - }} - /> - -); +> = (props) => { + const [value, setValue] = useState( + (props.defaultValue as number) || 0, + ); + + const handleChange = (e: React.ChangeEvent) => { + const newValue = +e.target.value; + setValue(newValue); + props.onChange && props.onChange(newValue); + }; + + return ( + + + + + ); +};