Hi! I have an input multiselect element and I am trying to give users the option to add a new option to the multi select input list by filling in the blank and clicking on the “add” button (the default way to add tags is not very intuitive so I wanted to make it more obvious):
The input multi select element is binded to a collection. (in the screenshot above, collection has 2 items before attempting to add a new one)
How do I configure the “add” button’s workflow such that when users click on “add”, whatever they typed into the blank is saved to the collection back-end AND becomes a selected option automatically?
My current button workflow when someone clicks on “add”:
Action 1: POST and save whatever is typed in the blank to the collection backend
Action 2: Add result from action 1 to the end of the “input-multiselect - current selection” variable
Action 3: Refetch the collection
Action 1 screenshot:
Action 2 screenshot:
However, when I click on “add” right now, my new tag does not show up in the selected tags. (supposed to have 3 options shown after adding, but there is only 2 still).
The “input-multiselect - current selection” variable input has 3 ids shown though, but the 3rd one is not showing up in the selected tags.
And then when I click on the dropdown list, I see the new option I just added (still not selected correctly), but it is duplicated:
In the database, it is not duplicated though. So it was saved correctly to my database. But it is now showing up correctly in Weweb.
Help I must be doing something incorrectly OR there is a bug where the selected tags is not being updated when the corresponding variable is not being updated…