@danielgindi/selectbox 1.0.143 → 1.0.145

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/lib.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @danielgindi/selectbox 1.0.143
2
+ * @danielgindi/selectbox 1.0.145
3
3
  * git://github.com/danielgindi/selectbox.git
4
4
  */
5
5
  'use strict';
@@ -2344,7 +2344,29 @@ class DropList {
2344
2344
 
2345
2345
  if (p.estimateWidth || p.virtualListHelper.isVirtual()) {
2346
2346
  p.virtualListHelper.createGhostItemElement(GhostSymbol, true, (itemEl) => {
2347
- p.lastMeasureItemWidth = Css.getElementWidth(itemEl, true, true);
2347
+ let measureScroll = Dom.createElement('span', {
2348
+ css: {
2349
+ display: 'block',
2350
+ width: '100px',
2351
+ height: '100px',
2352
+ overflow: 'scroll',
2353
+ position: 'absolute'
2354
+ }
2355
+ });
2356
+ let measureScrollParent = Dom.createElement('span', {
2357
+ css: {
2358
+ display: 'block',
2359
+ position: 'relative',
2360
+ width: '0',
2361
+ height: '0',
2362
+ overflow: 'hidden'
2363
+ }
2364
+ }, [measureScroll]);
2365
+ itemEl.appendChild(measureScrollParent);
2366
+ let vertScrollBarWidth = measureScroll.offsetWidth - measureScroll.clientWidth;
2367
+ itemEl.removeChild(measureScrollParent);
2368
+
2369
+ p.lastMeasureItemWidth = Css.getElementWidth(itemEl, true, true) + vertScrollBarWidth;
2348
2370
  });
2349
2371
  }
2350
2372