Thanks for the question. The behavior you are seeing with setVisible is definitely a bug and I have files an
issue on github. I plan on fixing this by next release at the end of June, however if you need a fix before then I have created a
code sandbox with a custom toolbox that will fix this issue. You would include this toolbox for now and then when you update to the latest release you could remove it.
Sorry for the inconvenience. Let me know if you have any problems with the example I sent or any other questions!