You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it looks like the behaviour requires an initial value must be set on the model. this isn't ideal if we're trying to show off a placeholder first as well as force the user to make an explicit choice.
an example secnariowould be choosing their country for a telephone number.
following code:
select(selectize, placeholder="Choose a country", ng-model="user.nationality", ng-options="country.name for country in countries")
Unless user.nationality has been initialised to one of the choices, this breaks the typeahead of selectize and adds an empty row. Any advice on how to proceed?
The text was updated successfully, but these errors were encountered:
@conoremclaughlin Thanks for the feedback -- it's not a bother at all. Even if I wasn't reopening this issue.
Angular-selectize supports the placeholder attribute, however, the model has to be explicitly initialized to null for the placeholder to be displayed. An undefined model should display the placeholder and not add an empty row. In this instance I don't think it makes sense for the selectize directive to follow Angular's standard behavior.
EvanOxfeld
changed the title
Initializing ng-model to a null value adds a null dropdown option and breaks typing
Undefined ngModel adds a null dropdown option, doesn't diplay the placeholder, and breaks typing
Sep 3, 2014
appreciate your work on this!
it looks like the behaviour requires an initial value must be set on the model. this isn't ideal if we're trying to show off a placeholder first as well as force the user to make an explicit choice.
an example secnariowould be choosing their country for a telephone number.
following code:
Unless user.nationality has been initialised to one of the choices, this breaks the typeahead of selectize and adds an empty row. Any advice on how to proceed?
The text was updated successfully, but these errors were encountered: