radix-vue / radix-vue

Vue port of Radix UI Primitives. An open-source UI component library for building high-quality, accessible design systems and web apps.

Home Page:https://radix-vue.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature]: Treat null as an empty value for Select

kilobyte2007 opened this issue · comments

Describe the feature

From what I see here, for the Select component - only undefined and '' is treated as an empty value - see here: https://github.com/radix-vue/radix-vue/blob/main/packages/radix-vue/src/Select/utils.ts

Is there any reason why null is not treated the same way? If it's a design decision - I think it would make sense to have a way to configure this somehow.

The same situation is present in ToggleGroup, Calendar, and some other components where null is not accepted as a type while it's a pretty common situation where some values can come as null from a backend or API.

Additional information

  • I intend to submit a PR for this feature.
  • I have already implemented and/or tested this feature.

Thanks for the issue @kilobyte2007 .. I think it make sense to consider null as nullish value and show the placeholder here