Wasted several hours only to realize that viewport meta was missing from my code. Adding here just in case some one else misses it out.
As soon as I added this, the toggle started working fine.
<meta name="viewport" content="width=device-width, initial-scale=1">