Skip to content

Update input field dynamically from another one #507

Closed Answered by jonas-grgt
thejezzi asked this question in Q&A
Discussion options

You must be logged in to vote

I had a similar issue and I solved it using bubbletea + state.

In your case I think something similar would work.
In the Update you could introspected the firstValue and based on that I set the secondValue to something. The downside is that this requires to recreate to form again the consequence of that is that your cursor will return back to the first field. I solved this by manually moving the cursor to the right position using the NextField function.

It works but it is very clunky and error prone.

Hope this makes sense.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@thejezzi
Comment options

Answer selected by thejezzi
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