'Add string into a list and remove the text in the search bar of a SearchInput / textinput

Lets say I have a searchInput from shinyWidgets or regular textinput from Shiny on my app.

I want the user to able to write something, press enter - the code adds that into a list. Such that search_1 ENTER, search_2 ENTER, search_3 ENTER

That searchinput UI shall be reset everytime enter is hit.

Output needs to be "search_1, search_2, search_3"

I have workaround for now, with searchInput splits the input text with ", " so the user needs to type "search_1, search_2, search_3" themselves, which is not optimal for the use.

Hope could this be done? Thanks in advance!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source