Skip to content
This repository has been archived by the owner on Aug 29, 2023. It is now read-only.

Using <md-select> with <md-option> of '<' fails #5847

Closed
djmarcus1 opened this issue Nov 20, 2015 · 2 comments
Closed

Using <md-select> with <md-option> of '<' fails #5847

djmarcus1 opened this issue Nov 20, 2015 · 2 comments
Milestone

Comments

@djmarcus1
Copy link

I use <md-option> to display math boolean operators for the user to select.

<md-select ng-model="operator" style="width: 75px" aria-label="Select comparison operator">
  <md-option ng-value="lessThan">&lt;</md-option>
  <md-option ng-value="lessThanEqual">&lt;=</md-option> 
  <md-option ng-value="equal">=</md-option>
  <md-option ng-value="true">true</md-option>
</md-select>

See codepen: http://codepen.io/djmarcus/pen/avMeod

When I select the < option, the selected value becomes =.

When I do the same thing using a regular <select>, it works:

<select>
  <option value="lessThan">&lt;</option> 
  <option value="lessThanEqual" selected>&lt;=</option>
  <option value="equal">=</option>
  <option value="true">true</option>
</select>

A personal guess on what is going on:

I see, using Chrome DOM element inspection, that the DOM generated is something like:

<md-select-value class="md-select-value" id="select_value_label_137">
  <span>=</span>
  <span class="md-select-icon" aria-hidden="true"></span>
</md-select-value>

Note the <span>=</span>

I assume one of these is generated for each <md-option>.

So, my first option is &lt; which would generate a <

So if it tries to generate <span><</span> there would be a problem.

Just a guess. I tried single-stepping the code with a debugger but could not follow all the transformations that take place :-(

@rschmukler rschmukler added this to the 1.0-rc5 milestone Nov 20, 2015
@rschmukler
Copy link
Contributor

potentially related to #2242

@djmarcus1
Copy link
Author

I think that this issue has been closed prematurely.

I tried rc4 with the changes of e07c52d but the problem reported in codepen http://codepen.io/djmarcus/pen/avMeod?editors=101 is still there

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