You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
The text was updated successfully, but these errors were encountered:
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?
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
changed the title
[Feature Request] Allow overrides of inner props
Allow overrides of inner props in MultiSelect
Jul 3, 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.The text was updated successfully, but these errors were encountered: