I'd like to be able to give the <input> an id in order to link it with a label:
<label for="my-input">...</label>
{{#power-select id="my-input" ... }}..{{/power-select}}
which will put the id onto the <input> element. At the moment the id is put onto the component element (standard ember behavior, so maybe not id but something that is passed along to the <input> element).
@gossi By default the power-select in single mode has no input displayed (it is rendered when the select opens), so I think that if this gets implemented, it should point to the ID of the trigger component. I think that this would focus it, and the onfocus action can be used to open the component.
Aaah, yes. I inspected a multiple component.
Some more background: when I have a <label> assigned with an input, I can click the label and the input is focussed, means I can start typing. So, it should be assigned to the element, that is receiving all key inputs (either for cursor keys or to start navigating or typing text to start a search).
it might look weird but
$($('.ember-power-select-trigger')[0]).focus()
seems to work in both Chrome and Edge browsers
@cibernox: Why did you close this ticket? Is this feature no longer being considered?
In contrast to the native behaviour, the power-select addon behaves different:
Kind | Behaviour
--- | ---
Native | If corresponding label is clicked, the select box is focussed but still closed; see this bin.
Power select | If corresponding label is clicked, the select box is not focussed.
Allowing the trigger to have an ID is relatively easy. However making the select gain the focus when a label is clicked is more complex than just adding an ID and will require some thought, but it's certainly something I'd like to do.
Allowing the trigger to have an ID is relatively easy.
Looks like this much was done in #799.
Most helpful comment
Allowing the trigger to have an ID is relatively easy. However making the select gain the focus when a label is clicked is more complex than just adding an ID and will require some thought, but it's certainly something I'd like to do.