Bug introduced in 11 or earlier and persisting through 12.0.0


Example 1

  Dynamic[Print@RandomReal[]; "on", UpdateInterval -> .5, SynchronousUpdating -> False]
 ImageSize -> Automatic

Once you switch to pane 2 it will not stop priniting even if you go back to 1. It does not happen when SynchronousUpdating is True.

Example 2

  PopupMenu[Dynamic[n], {1, 2}],
   {1 -> Dynamic[Echo[{1, Now}]; n, SynchronousUpdating -> False ],
    2 -> Dynamic[Echo[{2, Now}]; 2 n , SynchronousUpdating -> False]
   ImageSize -> Automatic

I expect each Dynamic to evaluate only when is visible, that is why ImageSize->Automatic is there.

The very first time it works well. But then, when n is changed with PopupMenu, which should refresh currently visible tab, all previously visited tabs are refreshed...

enter image description here

If SynchronousUpdating -> False is True everything is as expected:

enter image description here

While I don't insist on any behavior, they should at least be consistent.

Have I missed anything?

Related topics

Together with other 'issues' it makes controlling TabView/PaneSelector/MenuView and friends really painful:

Why is PaneSelector caching nested Dynamics and how to switch it off?

What is the point of PaneSelector?

  • 2
    $\begingroup$ So if your app runs slowly even though you took care about wrapping stuff with Dynamic to delay refreshing etc, now you know. $\endgroup$ – Kuba Jun 7 '18 at 12:58
  • $\begingroup$ Try with Print instead of Echo. I think this is the difference between Echo returning the expression and Print not doing so. However, notice that all tabs that are selected between aPopupMenu selection are marked for update. You can see this clearer by adding a third tab, updating PopupMenu select, another tab, select the original tab, then update PopupMenu. $\endgroup$ – Edmund Jun 7 '18 at 15:13
  • $\begingroup$ @Edmund I don't see any difference with Print, except of where it is printed. And yes, I know, I said "all previously visited tabs are refreshed". $\endgroup$ – Kuba Jun 7 '18 at 15:24
  • $\begingroup$ When I use Print instead of Echo then only the visible tab prints. I am on 11.3. What version are you on? $\endgroup$ – Edmund Jun 7 '18 at 15:27
  • $\begingroup$ @Edmund V11.3 on Win10. $\endgroup$ – Kuba Jun 7 '18 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.