Hello! I'm working on a custom input where I would like the user to press a button and have additional textInput elements appear. For reasons that allude me, each time the button is pressed, the number of new inputs doubles. Following this article on dynamic UIs, I call both Shiny.unbindAll()
before inserting a new element and Shiny.bindAll()
afterwards. Interestingly, when I remove those calls, pressing the button correctly inserts only one textInput. Of course, their values are not accessible by Shiny, though.
I'm relatively new to custom input bindings, so it's probable I don't understand something correctly or have the unbind and bind functions in the wrong place. Any advice on how I can achieve my goal, though, would be greatly appreciated!
You can see the problematic input with this live demo and check the code out here.