0

I'm taking baby steps with Angular and writing simple stuff and testing across browsers, I have a simple script to bind a menu against a JSON string array. I want to do the whole Angular MVC instead of Javascript DOM manipulation.

In my tests I can see a strange behaviour as to the positioning of the top of the menu in IE dependent upon which item is selected. Anyone know how to fix this? I would like to use an Angular friendly solution, like Bootstrap?

Menu looks good in Firefox and Chrome.

<html ng-app="myNoteApp">
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
    <div ng-controller="myCarSelector">
        <h2>Menu</h2>
        <p>Make of car : <span ng-bind="selectedCarMake"></span></p>
        <select ng-model="selectedCarMake" ng-options="val for val in carmakes"></select>
    </div>

    <script>
        // was in separate file but pasted in for demo purposes
        var app = angular.module("myNoteApp", []);
    </script>
    <script>
        // was in separate file but pasted in for demo purposes
        app.controller("myCarSelector", function ($scope) {
            $scope.selectedCarMake = "BMW"; // default value
            $scope.carmakes = ["Audi", "BMW", "Volkswagen"];
        });
    </script>
</body>
</html>

I like to accept answers and then move on to next question.

Here is a screen grab of the problem in IE 11 enter image description here

4
  • This looked fine to me, can you include an image of what you're seeing? Also which IE? Commented Jul 8, 2015 at 11:33
  • added screengrab, and its IE 11 (on Win8.1) Commented Jul 8, 2015 at 11:50
  • 1
    Nothing to do about it (the browser renders it and you don't have any control over it) except stop using a select and switch to a cross-browser solution like ui-select (github.com/angular-ui/ui-select). Commented Jul 8, 2015 at 11:52
  • @Sergui: I am very new to Angular. If you can post an alternative listing I can accept your answer. (I have browsed the git hub link you've given but it is greek to me) Commented Jul 8, 2015 at 14:47

1 Answer 1

0

It seems browser default behaviour.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.