Skip to content

Initial "selected" value does not populate the input #132

@christophersansone

Description

@christophersansone

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions