Question · Vibe coding with Claude Code course · Module 4: Instagram clone

Quiz: Blocking Scrolling Under the Window

How do you block page scrolling under an open window so that it comes back after closing?

Answer options

  • Set overflow to hidden in the onClick that opens the window
  • Add the overflow-hidden class to the white window
  • In useEffect remember overflow, set hidden and restore it in the cleanup function
  • Call window.stopScroll() when the window opens

You can check the correct answer by solving this task in the CodeWorlds game.