prevent caret moving with menu