Skip to content

Support for cascading comboboxes? #176

Closed Answered by josefarias
jpalma-savvy asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @jpalma-savvy, good question!

I'd just replace the affected combobox as a whole with a turbo stream. That way you'll always have a blank slate, regardless of any future changes to the library.

So I'd wrap the first combobox in an autosubmitting form (or a stimulus controller if you don't want many forms) and have that perform a turbo stream request to the server, which will then know to replace the second combobox altogether with the right config. And so on until you reach the last combobox.

Recall that the html spec doesn't allow nested forms. Just mentioning it because it's a common gotcha and it should inform how you structure your markup and your choice for using forms or stimulus…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jpalma-savvy
Comment options

Answer selected by jpalma-savvy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants