auto-form icon indicating copy to clipboard operation
auto-form copied to clipboard

The label and value are the same when using nativeEnum

Open JIASENG126 opened this issue 2 years ago • 2 comments

To begin, I want to express my gratitude for the chance to propose enhancements to this project!

Description:

I've observed that when utilizing nativeEnum, the values for label and value coincide. Furthermore, I believe it would be advantageous if radio-group could also accommodate the label and value format.

Changes Made:

  • Adjusted the transmission of values for label and value within the enum.
  • Enhanced radio-group to support the label and value format similarly when using nativeEnum.

JIASENG126 avatar Apr 28 '24 01:04 JIASENG126

Wouldn't this change break the default zod enum?

andrewdoro avatar May 01 '24 13:05 andrewdoro

Yes I feel like this would break the zod validation as the zod enum uses the value only?

Keep in mind that zod will validate and return the enum labels, not the enum values!

vantezzen avatar May 02 '24 12:05 vantezzen