ember-power-select
ember-power-select copied to clipboard
Public API to control selection
It would be great to be able to set selectionStart, selectionEnd and possibly selectionDirection programmatically. It can also be used to set the cursor position by setting selectionStart = selectionEnd.
I'm confused. What are the selectionStart and selectionEnd that you mention?
Sorry for being vague. And I now realize this might only make sense after customizing ember-power-select as it's done at https://miguelcobain.github.io/ember-paper/#/components/autocomplete - i.e combining the search and trigger component into one.
The use case I have is when populating the search with certain content you might want to help the user by positioning the cursor to a placeholder position fx. to hint the user that they have chosen a road (represented by name + postalcode + city) and that they now should enter a number inbetween the road name and postalcode to filter the result down to individual adresses).
The mentioned properties are documented at https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement and what I'm after is to be able to mutate them. They are individually settable or with a single call using https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange.