Skip to content
This repository has been archived by the owner on Sep 8, 2020. It is now read-only.

Empty <option> shows 2 empty fields in angular 1.4.8 #296

Open
Vayvala opened this issue Jan 18, 2016 · 1 comment
Open

Empty <option> shows 2 empty fields in angular 1.4.8 #296

Vayvala opened this issue Jan 18, 2016 · 1 comment

Comments

@Vayvala
Copy link

Vayvala commented Jan 18, 2016

I am using angular-ui-select for dropdowns. I need to have dropdown that you can cancel.

Here is my dropdown in template:

<select ui-select2="select2Options" name="Machine" ng-model="selectedMachine.type" data-placeholder="type" required>
    <option value=""></option>
    <option ng-repeat="type in machineTypes" value="{{type}}">{{type}}</option>
</select>

Here is select2Options:

$rootScope.select2Options = {
  minimumResultsForSearch: 5,
  allowClear: true,
  ...
}

Here is the result:
enter image description here
enter image description here

As you can see, there is a cancel button (and it works), but something weird happens on the picture to the left. Cause of the <option value=""></option> there are two empty fields that you can check.

If you delete <option value=""></option>, weird empty fields disappear, however there is no cancel button either:
enter image description here

angular: v1.4.8
angular-ui-select2: v0.0.5
select2: v3.4

@Vayvala Vayvala changed the title Empty <option> shows 2 empty fields Empty <option> shows 2 empty fields in angular 1.4.8 Jan 18, 2016
@hungyc
Copy link

hungyc commented May 11, 2016

Same issue, any solutions?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants