Skip to content

Suffix will get added to numerical input #548

@xiduzo

Description

@xiduzo

When adding a suffix to a numerical input value, the value changes to a string with the suffix attached.

I expected the suffix to be purely visual.

import { useControls } from "leva";
import "./styles.css";

export default function App() {
  const { test } = useControls({
    test: {
      value: 10,
      min: 10,
      suffix: "ms",
      onChange: (event) => console.log(event),
      transient: false,
    },
  });
  return (
    <div className="App">
      <h1>Output</h1>
      <h2>{test}</h2>
    </div>
  );
}

Will output

Image

Live example: https://codesandbox.io/p/sandbox/pedantic-almeida-g7np32

Metadata

Metadata

Assignees

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