diff --git a/src/client/lazy-app/Compress/Options/Range/index.tsx b/src/client/lazy-app/Compress/Options/Range/index.tsx index da6e37e2..8b1150e3 100644 --- a/src/client/lazy-app/Compress/Options/Range/index.tsx +++ b/src/client/lazy-app/Compress/Options/Range/index.tsx @@ -6,10 +6,13 @@ import './custom-els/RangeInput'; import { linkRef } from 'shared/prerendered-app/util'; interface Props extends preact.JSX.HTMLAttributes {} -interface State {} +interface State { + textFocused: boolean; +} export default class Range extends Component { rangeWc?: RangeInputElement; + inputEl?: HTMLInputElement; private onTextInput = (event: Event) => { const input = event.target as HTMLInputElement; @@ -23,10 +26,19 @@ export default class Range extends Component { ); }; - render(props: Props) { + private onTextFocus = () => { + this.setState({ textFocused: true }); + }; + + private onTextBlur = () => { + this.setState({ textFocused: false }); + }; + + render(props: Props, state: State) { const { children, ...otherProps } = props; const { value, min, max, step } = props; + const textValue = state.textFocused ? this.inputEl!.value : value; return ( );