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

Allow overrides of inner props in MultiSelect #3475

Open
tyscorp opened this issue Apr 12, 2019 · 2 comments
Open

Allow overrides of inner props in MultiSelect #3475

tyscorp opened this issue Apr 12, 2019 · 2 comments

Comments

@tyscorp
Copy link
Contributor

tyscorp commented Apr 12, 2019

Feature request

I would like the ability to override the props that blueprint passes to child components. This is required for more advanced modifications of blueprint's behavior. Currently, the only option is to either copy+paste a lot of code or monkeypatch the components themselves. All that is required would be to move the {...innerProps} below the ones blueprint passes in.

Examples

https://github.com/palantir/blueprint/blob/develop/packages/select/src/components/select/multiSelect.tsx#L133

It is currently impossible to override the onAdd TagInputProp.

This change could potentially make it easier to unintentionally break things. Perhaps an explicit overrideTagInputProps boolean could help prevent that.

@adidahiya
Copy link
Contributor

The location of the props spread object (like the one you linked) is set intentionally in all components based on a design tradeoff between out-of-the-box usability and flexibility. We might consider changing it on a case-by-case basis to allow overriding certain props, such as the onAdd prop you have suggested, but I don't think we'd make a general change to all components to move the props spread to the end of the JSX tag expression. Can you share more details about your use case? Why do you want to override onAdd? If there are other props in other components which you want to override, can you share those too?

@tyscorp
Copy link
Contributor Author

tyscorp commented Apr 15, 2019

In this case I wanted to override onAdd to use the addOnBlur functionality from TagInput in MultiSelect because simply using tagInputProps.onBlur results in two items being added. There have been other times over the past few years but tbh I've forgotten exactly what they were. Perhaps it would be better to add addOnBlur support to MultiSelect natively rather than trying to patch blueprint's behavior?

@adidahiya adidahiya changed the title [Feature Request] Allow overrides of inner props Allow overrides of inner props in MultiSelect Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants