When the component is pre-populated with a selected value upon creation, the value is not presented in the input. It is presented in the drop-down, but not the input. The only way to get the value to show is to select another option.
This use case is helpful when the developer wants to present a default value to the user, or in the case where it is being used as a data-driven property of an existing object.
To reproduce:
import Component from '@glimmer/component';
import { tracking } from '@glimmer/tracking';
export default class TestComponent extends Component {
options = [ 'one', 'two', 'three', 'four', 'five' ];
@tracked selected = 'three';
}
<PowerSelectTypeahead @options={{this.options}} @selected={{this.selected}} @onChange={{action (mut this.selected)}} />
Expected behavior: The input text should show 'three'.
Actual behavior: The input text is empty.
When the component is pre-populated with a
selectedvalue upon creation, the value is not presented in the input. It is presented in the drop-down, but not the input. The only way to get the value to show is to select another option.This use case is helpful when the developer wants to present a default value to the user, or in the case where it is being used as a data-driven property of an existing object.
To reproduce:
Expected behavior: The input text should show 'three'.
Actual behavior: The input text is empty.