Unable to collapse code block after indentation

This is a code block indented inside heading ‘Step 5…‘. According to me this should be collapsed when I hit the arrow key beside the heading but it seems to appear on page cluttering the view.

I request you to resolve it