Can't collapse focused code after republishing

Steps:

  1. create a notebook and publish it
  2. edit an unpinned cell
  3. with the editor still focused, republish the changes
  4. observe that the code cannot be collapsed without reloading or entering edit mode