Skip to content

Commit

Permalink
fix: array method error in IE (#283)
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb authored Jun 7, 2018
1 parent 0ff91fa commit 0932a27
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,12 +323,14 @@ export default class Resizable extends React.Component<ResizableProps, State> {
get base(): ?HTMLElement {
const parent = this.parentNode;
if (!parent) return undefined;
return [...parent.children].find((n: HTMLElement) => {
const children = [].slice.call(parent.children);
for (let i = 0; i < children.length; i += 1) {
const n = children[i];
if (n instanceof HTMLElement) {
return n.classList.contains(baseClassName);
}
return undefined;
});
}
return undefined;
}

calculateNewSize(newSize: number | string, kind: 'width' | 'height'): number | string {
Expand Down

0 comments on commit 0932a27

Please sign in to comment.