does Update() get called even when there are no keys being pressed? #970
Replies: 2 comments
-
I am guessing there are commands returned by the text input you are using and updating in this code... m.answerField, cmd = m.answerField.Update(msg)
return m, cmd The text input might have a blink or something that needs the view to update. Set a break point on the lines above and see what commands are returned. |
Beta Was this translation helpful? Give feedback.
-
I hope that helps! Lemme know if it's still not clear |
Beta Was this translation helpful? Give feedback.
-
Hi,
I have just started using this library (pretty new to golang, as well), and I am following the youtube video tutorial where text input is used to input answers for a series of questions. What I am noticing is that Update function is getting called even though no keys are being pressed.
I have added
log.Println("update is called. type: ", msg)
as the default case in the switch stmt of Update() function and I can see this log getting printed atleast twice per second with information. What is the struct that is getting printed here?sample log below.
I believe this is not an issue, but a gap in my understanding. Could you please help me understand why this is happening? Any further documentations that I should go through?
Below is the code:
Beta Was this translation helpful? Give feedback.
All reactions