Update input width when entering edit mode and clear mirror text when leaving edit mode