mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

PinInput component populates old values when using Backspace #6870

Closed Vurmevska closed 1 month ago

Vurmevska commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

"^7.12.2"

What package has an issue?

@mantine/core

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Chrome

Describe the bug

Steps to reproduce:

import { PinInput } from "@mantine/core";
import { useState } from "react";

const TestExample = (): JSX.Element => {
  const [value, setValue] = useState<string | undefined>(undefined);

  return <PinInput value={value} onChange={(value) => setValue(value)} />;
};

export default TestExample;

Peek 2024-09-23 14-27

If possible, include a link to a codesandbox with a minimal reproduction

https://codesandbox.io/p/sandbox/mantine-react-template-forked-jqdxwr?file=%2Fsrc%2FApp.tsx%3A13%2C1

Possible fix

No response

Self-service