Fix #3589 Incorrect preview URL after changing in menu state
Add tests for #3589
Merge pull request #3605 from yakky/feature/fix_3589

Merge #3589 with tests
Fix #3589