Moved the hidden state change and added tests for that in the save event.