Skip to content

When passing the initialValues { SELECT_OPTION : 0 } in schema then in select that value not showing as selected. #1433

Description

@anjalikalsariya

Select field

{
   "name": "SELECT_OPTION",
   "label": "test",
   "options": [
     { "label": "none", "value": 0 },
     { "label": "2", "value": 2 },
   ],
   "component": "select"
 },
Note:  I'm using the ant-component-mapper.

Can you help me for it?

Activity

  1. rvsia commented on Jan 4, 2024

    @rvsia
    Contributor

    This is because javascript resolves 0 as false so the select thinks there is no value. @Hyperkid123 we could probably fix it. As a workaround, @anjalikalsariya, use string and then convert it to a number. 😸

  2. anjalikalsariya commented on Jan 4, 2024

    @anjalikalsariya
    Author

    Correct @rvsia. I got it.
    For now, let me add that convert solution. Later, If anything will be changing in the library to fix this issue that will be more helpful.

  3. anjalikalsariya commented on Jan 4, 2024

    @anjalikalsariya
    Author

    One more thing is when the value is 0 and validation is required then also throws an error for an empty field. Validation does not work with the value 0 integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ANTbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions