Can't clear inputValue property of multiSelect programatically

After inputValue property is set by typing a text in a multiSelect component, can't clear it programatically, there are clearValue, resetValue, value, data and etc., but they are not giving effect to clear the inputValue, even inputValue = null doesn't work.

How to clear inputValue of multiselect?

In what manner are you trying to clear the value(s), an event, a button, other?

Screenshots?

Trying to do this on button click. Here is the flow to reproduce

  1. Add Multiselect, type Option 3 and then click aside
  2. Add Text component and bind to {{ Multiselect1.inputValue }}
  3. Add button and run script Mutiselect1.inputValue"";

You can see that inputValue is still there and I can't clear it

Screenshot 2025-02-18 at 1.26.02 PM
Use an event handler in the button compent

It doesn't help, just try to reproduce

Here is click event handler

Multiselect itself, type any text and make mouse aside click

Clicking on the button, but Text still contains an inputValue

@Fikret_Huseynkhanov i can confirm that this is not possible. Retool simply hasn't exposed the method to clear the inputValue property.

I even tried placing the multiselect inside a form, and the resetting the form. Did not work.


In case this has to do with your previous query (adding custom val to multiselect), let me know the exact outcome you want to achieve, and i might be able to suggest an alternative method.

1 Like

Hi @Toolshed,

Thank you for your continuos support. I've used your example and with a bit modificaiton especially for my case, I could implement the behavior that I want to achieve and during the same exercise I realized that it's impossible to clear the inputValue which is not good actually and workaround is needed :slight_smile:

Once again, thank you so much for your help.

Don't mention it :handshake:
If required, feel free to share a loom.com in which you explain what you're trying to achieve and i'll be happy to take a look.

Don't forget to mark the original answer as ":white_check_mark: Solved" to make it easy for other people coming to this post.

Regards

This is for a multi-select and it DOES work for me.

Screenshot 2025-02-19 at 8.33.01 AM

Click button and options are cleared if using an event handler in the Button component

Screenshot 2025-02-19 at 8.33.52 AM

1 Like

@ScottR you are demoing how to clear values, not inputValue. inputValue is a separate property in the state of the multiselect that corresponds to the text that the user starts typing in the multiselect for auto-completion.

1 Like

Got it, so what's the use case to clear inputValue when the user is typing? Just curious

OP used the inputValue property to work around another multiselect related limitation in Retool - lack of support of custom values in the multiselect.

Link to that post

1 Like