Otherwise the appropriate message won't be sent. AttachedToWindow() will take care of selecting in that case. Fixes #18891.