@zohodesk/components 1.0.0-temp-352 → 1.0.0-temp-444
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.
|
@@ -146,9 +146,10 @@ export default class ResizeComponent extends React.Component {
|
|
|
146
146
|
onResize(size) {
|
|
147
147
|
if (size) {
|
|
148
148
|
window.requestAnimationFrame(() => {
|
|
149
|
-
if (this.height !== size.height || this.width !== size.width && !this.isAnimating) {
|
|
149
|
+
if ((this.height !== size.height || this.width !== size.width || this.scrollWidth !== size.scrollWidth) && !this.isAnimating) {
|
|
150
150
|
this.height = size.height;
|
|
151
151
|
this.width = size.width;
|
|
152
|
+
this.scrollWidth = size.scrollWidth;
|
|
152
153
|
this.childrenCurrentList = [];
|
|
153
154
|
this.constructChildren(0, false);
|
|
154
155
|
}
|
|
@@ -180,7 +181,7 @@ export default class ResizeComponent extends React.Component {
|
|
|
180
181
|
let dataCount = 0;
|
|
181
182
|
this.noSpaceForChildren = false;
|
|
182
183
|
|
|
183
|
-
if (totalWidth <= moreWidth) {
|
|
184
|
+
if (totalWidth + moreWidth <= moreWidth) {
|
|
184
185
|
this.noSpaceForChildren = true;
|
|
185
186
|
} else {
|
|
186
187
|
for (let i = 0; i < childrenWidthList.length; i++) {
|
|
@@ -199,6 +200,8 @@ export default class ResizeComponent extends React.Component {
|
|
|
199
200
|
}
|
|
200
201
|
|
|
201
202
|
break;
|
|
203
|
+
} else {
|
|
204
|
+
dataCount++;
|
|
202
205
|
}
|
|
203
206
|
}
|
|
204
207
|
}
|
|
@@ -8,12 +8,16 @@ const mutationObserverOptions = {
|
|
|
8
8
|
function getSize(element) {
|
|
9
9
|
let {
|
|
10
10
|
offsetHeight,
|
|
11
|
-
offsetWidth
|
|
11
|
+
offsetWidth,
|
|
12
|
+
scrollHeight,
|
|
13
|
+
scrollWidth
|
|
12
14
|
} = element; // const { height, width } = element.getBoundingClientRect();
|
|
13
15
|
|
|
14
16
|
return {
|
|
15
17
|
height: offsetHeight,
|
|
16
|
-
width: offsetWidth
|
|
18
|
+
width: offsetWidth,
|
|
19
|
+
scrollHeight: scrollHeight,
|
|
20
|
+
scrollWidth: scrollWidth
|
|
17
21
|
};
|
|
18
22
|
}
|
|
19
23
|
|