Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select. Hide Already Selected #20240

Closed
1 task
cyberspacedk opened this issue Dec 13, 2019 · 1 comment
Closed
1 task

Select. Hide Already Selected #20240

cyberspacedk opened this issue Dec 13, 2019 · 1 comment
Assignees

Comments

@cyberspacedk
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Chose option in select option
Option should be removed from options and selected option should shown as Select value

What is expected?

The task is to filter options by removing them from the options array and showing chosen content value as Select value.

The selected option should:

  • disappear from the options array
  • displayed as select value

What is actually happening?

There is an array containing objects with a simple structure {value: 1, content: 'text'}
In this example with this structure {value: 1, content: 'text'}, only the value field is displayed, and the field not displayed

Environment Info
antd 3.20.7
React 16.9.0
System Ubuntu 19.04
Browser Chrome 77

There is a similar example in the library (example : "Hide Already Selected"), but it works exclusively with an array of simple structure like ['text-1', 'text-2', 'text-3']

@afc163
Copy link
Member

afc163 commented Dec 14, 2019

You can try labelInValue to store label in selected values.

https://codesandbox.io/s/ant-select-filtering-mqmj1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants