Enable the preview of easing presets when the curveEditorPopover opens

This commit is contained in:
Fülöp Kovács 2022-07-01 14:01:03 +02:00 committed by Fülöp
parent d1ef903355
commit fb02b297f1

View file

@ -279,8 +279,13 @@ const CurveEditorPopover: React.VFC<ICurveEditorPopoverProps> = (props) => {
e.stopPropagation() e.stopPropagation()
} }
} }
const onEasingOptionMouseOver = (item: {label: string; value: string}) => const onEasingOptionMouseOver = (item: {label: string; value: string}) => {
// Set the `textInputMode` to `auto` if it was `init` before
// to enable the easing previews
if (textInputMode === TextInputMode.init)
setTextInputMode(TextInputMode.auto)
setPreview(item.value) setPreview(item.value)
}
const onEasingOptionMouseOut = () => setPreview(null) const onEasingOptionMouseOut = () => setPreview(null)
const onSelectEasingOption = (item: {label: string; value: string}) => { const onSelectEasingOption = (item: {label: string; value: string}) => {
setTempValue(tempTransaction, allConnections, item.value) setTempValue(tempTransaction, allConnections, item.value)