Disable contenteditable on buttons and everything with onClick or other event handlers, or make sure it doesn't reset the state.