Skip to content

String input value only changes when losing focus #599

@EnbyAce

Description

@EnbyAce

Here I have some example code:

import { useEffect } from "react";
import { useControls } from "leva";

export default function EditorPage() {
    const values = useControls({
        test: { value: "", label: "Test input" }
    });

    useEffect(() => console.log(values.test), [values.test]);

    return <></>;
}

I would expect this to log the test input's value every time it changes, but it only does that when I click away from the input. Is there a way to update the value every time I add or remove a character in the input?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions