Fix focus issue when clicking button before focusing on editor