Selectmenu: Preserve text selection when interacting with the widget

Fixes #10144

I'm not sure if we want to go through the trouble of adding a unit test for this.