0

I am using Material in AngularJs. And I have noticed that when ng-model has a value which lies after a few options, the select opens above the wanted place. Is there any way to fix that? Here is a link to refer: https://codepen.io/Haris2301/pen/PoGZQqz

<md-input-container>
      <label>State</label>
      <md-select ng-model="ctrl.userState">
        <md-option><em>None</em></md-option>
        <md-option ng-repeat="state in ctrl.states" ng-value="state.abbrev" ng-disabled="$index === 1">
          {{state.abbrev}}
        </md-option>
      </md-select>
    </md-input-container>

Notice when you select an option lying somewhere in the middle and again option the md-select, it opens more upwards.

Haris
  • 21
  • 1
  • 2
  • 6
  • Are you talking about changing the position of the select menu? – tbone849 Dec 08 '20 at 15:24
  • Yes. Actually, what I think is that if I can somehow manage to change the position of the selected option, I can avoid the select menu coming more upwards than normal. – Haris Dec 09 '20 at 12:39
  • Why are you wanting to change the display position of the select menu? Is it covering something you need displayed? I’d try to shy away from this if at all possible. If it’s covering something you could move the other thing. – tbone849 Dec 09 '20 at 13:37
  • Actually, I can't change that. It's a list of questions where the answer is to be selected from the select menu. Changing the design is not an option for me. – Haris Dec 10 '20 at 14:57
  • Can you explain why you are wanting to move where the select opens? The behavior you described in the post is normal. When select option open, they show the top most option unless one is selected already, then it will scroll to show the selected option in view. – tbone849 Dec 10 '20 at 15:15
  • It opens differently when an option is selected and when no option is selected. I want it to open always the way it opens when no option is selected. – Haris Dec 12 '20 at 05:08
  • You always want the select menu to be scrolled to the top on open? – tbone849 Dec 12 '20 at 11:45
  • https://stackoverflow.com/a/44998846/5781575 – tbone849 Dec 12 '20 at 12:22

0 Answers0