This moved over from `password-mixin.js` to be more generic. If we are focusing elements, we pretty much always want the cursor to be at the end of the available text.