Skip to content

[BUG?] Antd useSelect hook with mode['multiple']; issue -> unique "key" prop & UI #4958

Closed Answered by w20k
w20k asked this question in Q&A
Discussion options

You must be logged in to vote

Found the option, how it's generated vie inferencer (aweomse thingy 😄 ), issue was related to antd form.item:

 <Form.Item
          label={translate('workers.fields.work_types')}
          name={'work_types'}
          rules={[
            {
              required: true,
            },
          ]}
          getValueProps={(value: any[]) => {
            return {
              value: value?.map((item) => item?.id),
            };
          }}
          getValueFromEvent={(selected: string[]) => {
            return selected?.map((item) => ({ id: item }));
          }}
        >
          <Select mode='multiple' {...workTypesSelectProps} />
        </Form.Item>

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@w20k
Comment options

@w20k
Comment options

Answer selected by w20k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants