Unable to bring md-button to the foreground in md-tabs

I am trying to add an area md-buttonto an area md-tabs. Using developer tools, I see that there is a button. This is not visible though:

Screenshot

I thought using a z-index in css with a very high value would solve the tghe problem, it is not:

.superclick {
  right: 0;
  position: absolute;
  z-index: 100;
}

Also, the button is not available, and I'm not sure the reason is that it lies in the background.

What am I missing here? How can I bring a button to the fore?

Please see my fiddle or my code:

<body>
<script>
angular.module('MyApp', ['ngMaterial'])

.controller('MyCtrl', function ($scope) {
  $scope.statuses = [
      {id: 1, name: "One", description: "First Tooltip"},
      {id: 2, name: "Two", description: "Second Tooltip"},
      {id: 3, name: "Three", description: "Third Tooltip"},
    ];

     $scope.addTab = function(){
      $scope.statuses.push({id: $scope.statuses.length + 1, name: $scope.statuses.length + 1, description: "New Tooltip"});
     }

   $scope.removeTab = function(status){
    alert(status.id);
    var index = $scope.statuses.indexOf(status);
    $scope.statuses.splice(index,1);
   }

});

</script>

<div ng-app="MyApp">
<div ng-controller="MyCtrl">
<md-content class="md-padding">
  <md-tabs class="" md-selected="selectedTab" md-align-tabs="top" md-border-bottom md-autoselect md-dynamic-height>

    <md-tab ng-repeat="status in statuses">
      <md-tab-label>
        {{status.name}}
        <md-tooltip md-direction="bottom">
          {{status.description}}
        </md-tooltip>
      </md-tab-label>
      <md-tab-body>
        <md-button ng-click="removeTab(status)">Remove Tab</md-button>
      </md-tab-body>
    </md-tab>

    <md-button class="superclick">Superclick</md-button>

    <!--<md-tab ng-click="addTab()">
      <md-tab-label> + Add Tab</md-tab-label>
            <md-tab-body>       
      </md-tab-body>
    </md-tab>-->

  </md-tabs>
</md-content>
</div>
</div>
</body>
+4
source share
1 answer

opacity position (. fiddle). .

md-tab-data {
  opacity:1;
  z-index: 100;
  display: inline-block;
  width:200px;
  float:right;
  position:relative;
}
+1

Source: https://habr.com/ru/post/1670058/


All Articles