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

It would be useful make select field searchable in uniforms-antd #203

Closed
Gervwyk opened this issue Feb 23, 2017 · 4 comments
Closed

It would be useful make select field searchable in uniforms-antd #203

Gervwyk opened this issue Feb 23, 2017 · 4 comments
Assignees
Labels
Type: Feature New features and feature requests

Comments

@Gervwyk
Copy link
Contributor

Gervwyk commented Feb 23, 2017

Not sure if it makes sense to includes this as an optional, but I think it might as well be always enabled.

Its real simple. Have a look at:
https://ant.design/components/select/#components-select-demo-search
it suggests to add:
filterOption={(input, option) => option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0}
to Select props.

The multi-select option is currently searchable. I have a suspicion that the transform option should be included here, since users want to search by label and not by value. However the selectfield documentation in lacking.

Would be useful since select list are often long (countries).

@radekmie radekmie self-assigned this Feb 23, 2017
@radekmie radekmie added the Type: Feature New features and feature requests label Feb 23, 2017
@radekmie
Copy link
Contributor

I'm strongly against setting it as a default, but there should be filterDOMProps In the SelectField, so you can use it already, like it's used in other fields and themes. Would you like to submit a PR for it?

@Gervwyk
Copy link
Contributor Author

Gervwyk commented Feb 23, 2017

Agreed. Will try some options tomorrow and send PR.

@radekmie
Copy link
Contributor

@Gervwyk?

@Gervwyk
Copy link
Contributor Author

Gervwyk commented Feb 28, 2017

Cool. It worked. Check PR.
Schema example for future users:

new SimpleSchema({
    size: {
        type: String,
        defaultValue: 'm',
        allowedValues: ['xs', 's', 'm', 'l', 'xl'],
        optional: true,
        uniforms: {
         showSearch: true,
         filterOption: (input, option) => option.props.value.toLowerCase().indexOf(input.toLowerCase()) >= 0
        }
    }
})

@radekmie radekmie moved this to Closed in Open Source Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

No branches or pull requests

2 participants