I have an InputField search that provides search suggestions, but I want an animation necklace to be displayed while the search is 'busy'. I would also like this to be done using Dynamic rather than Manipulate.
A simplified version of the code has been provided below:
Dynamic[
Column[{
Row[{
InputField[Dynamic[input], String, ContinuousAction -> True],
Refresh[
If[input != newInput, Animator[Appearance -> "Necklace"],
"Done"], TrackedSymbols :> {newInput}]
}],
Refresh[
Column[Pause[2]; Characters[input], newInput = input;,
Frame -> All, ItemSize -> 20],
TrackedSymbols :> {input}
]
}, Spacings -> 0]
]
Here Pause[2] has replaced the 'busy' search calculations, and Characters[input] has replaced the search suggestions.
Currently:
- Pause[2] is triggering twice instead of once.
- Search suggestions and busy necklace appear simultaneously. (suggestions should appear after necklace disappears)
- 'Busy necklace' does not animate.
End Goal:
- 'Busy necklace' to appear immediately after input is changed.
- Want to display an animated necklace while search is busy for the 2 seconds
- Want the search suggestions and 'Done' message to display simultaneously
Here are some similar posts that may be helpful in solving my problem:
Dynamic
parent of thoseRefreshes
then they will update each other anyway. $\endgroup$