Skip to content
This repository has been archived by the owner on May 14, 2019. It is now read-only.

Commit

Permalink
getBoundingClientRect() incorrectly reports width for hidden containers
Browse files Browse the repository at this point in the history
It is not possible to use minigrid on hidden container e.g. Bootstrap navbar menu items. Firstly you have to set display to initial and reset back
  • Loading branch information
insekticid committed May 23, 2016
1 parent 955150e commit 519afc7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/index.js
Expand Up @@ -55,6 +55,7 @@
var itemsNodeList = this.props.nodeList;

containerEle.style.width = '';
containerEle.style.display = 'initial';

var forEach = Array.prototype.forEach;
var containerWidth = containerEle.getBoundingClientRect().width;
Expand Down Expand Up @@ -97,6 +98,8 @@

});

containerEle.style.display = '';

var containerHeight = itemsGutter
.slice(0)
.sort(function (a, b) {
Expand Down

0 comments on commit 519afc7

Please sign in to comment.