diff --git a/packages/splitjs/README.md b/packages/splitjs/README.md index ad71ac6eb..138a44c9b 100644 --- a/packages/splitjs/README.md +++ b/packages/splitjs/README.md @@ -62,7 +62,7 @@ var Split = require('split.js') The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](http://unpkg.com/): ```html - + ``` You can find the library on `window.Split`. diff --git a/packages/splitjs/src/split.js b/packages/splitjs/src/split.js index 057776d5e..a65774359 100644 --- a/packages/splitjs/src/split.js +++ b/packages/splitjs/src/split.js @@ -381,6 +381,10 @@ const Split = (idsOption, options = {}) => { return sizesToTrim } + if (minSizes.reduce((a, b) => a + b, 0) > parentSize) { + return sizesToTrim + } + // Keep track of the excess pixels, the amount of pixels over the desired percentage // Also keep track of the elements with pixels to spare, to decrease after if needed let excessPixels = 0