I make a couple of tests locally using the code provided.
The result on my side is the expected one and could be observed in the video attached.
Please double-check for any JavaScript errors in the Developer Tools Console in the browser. If the issue persists, please send me a runnable sample or a dojo example where the pointed issue is represented.