sek-consulting / solid-ui

Beautifully designed components. Built with Kobalte & corvu. Styled with Tailwind CSS.
https://www.solid-ui.com
MIT License
890 stars 34 forks source link

OTP component - can't focus and edit inputs others than the last one #115

Closed T3sT3ro closed 3 months ago

T3sT3ro commented 3 months ago
  1. See the demo of the OTP field
  2. enter 123456
  3. try to click/shift-tab the input with "3" to correct it to 0
  4. You can't, only backspace is allowed

The OTP field should support fixing mistakes and editing individual inputs

sek-consulting commented 3 months ago

It behaves the same as the underlying corvu component: https://corvu.dev/docs/primitives/otp-field/

But feel free to open an issue over there if you think the behavior should be fixed. :)

T3sT3ro commented 3 months ago

The same issue is present on the Shadcn repo and it's marked as bug. I assume the components behavior here should be modeled primarily based on the shadcn, and although the same behavior is present in the corvu repo, in my opinion it should be only secondary, and the responsibility lies in this repo as well for the following two reasons:

I will report on corvu's website as well, but because it's not what I use, but what this repo uses under the hood, I chose this place to be more appropiate.

sek-consulting commented 3 months ago

The primitive dictates the behavior of the component (at least for the most part).

It's correct that SolidUI is inspired and mostly a direct port of shadcn-ui but it's using kobalte & corvu as the underlying layers. And since there are some differences in design decisions (in comparision to RadixUI) those are reflected in SolidUI.

A prime example would be having a TextField component instead of a separate Input, TextArea, Input one (even though I kept Input).

I know that might be confusing for people how come over from shadcn-ui but it makes it much easier if you're looking for information if you want to change something, since you can just follow the docs of the primitives.