Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

md-select not working properly with Angular 1.7.7 #16830

Description

@Mike-Bauer

I'm submitting a ...

  • [x ] bug report
  • feature request
  • other

Current behavior:

Angular 1.7.7 results in a problem for the Angular Material md-select directive when the directive has the required attribute, has a parent with an ng-if, and the md-select's ng-model is given an initial value. The directive incorrectly flags a required error and the displayed select option shows a trailing asterisk.

Expected / new behavior:

The md-select should not flag a required error and the displayed selected option should not show an asterisk.

Minimal reproduction of the problem with instructions:

In Controller:

$scope.selectModel = 'option1';
$scope.showSelect = true;

In View:

<md-input-container ng-if='showSelect'>
  <label> Select </label>
  <md-select ng-model='selectModel' required>
    <md-option value='option1'> Option 1 </md-option>
    <md-option value='option2'> Option 2 </md-option>
  </md-select>
</md-input-container>

AngularJS version: 1.7.7

AngularJS Material version: 1.1.12

Browser: Chrome 71.0.3578.98 | Firefox 64.0.2 | Edge 42.17134.1.0

Anything else:

screen shot 02-08-19 at 02 27 pm

screen shot 02-08-19 at 02 27 pm 001

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions