Skip to content

How to change a dropdown's options based on a text field? #3198

Answered by akshayka
failable asked this question in Q&A
Discussion options

You must be logged in to vote

Don't use mo.state(), and don't use on_change handlers. They should be used exceedingly rarely, and almost always lead to trouble.

You need to use marimo's built-in reactivity. Run marimo tutorial ui to understand how this works or read our docs.

Here is an example:

Notebook link: https://marimo.app/l/vfwyu0

Out of curiosity, how and why did you decide to use mo.state and on_change? I would really strongly like to discourage users from doing this.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by akshayka
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