Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added `anchorClassName` prop to `EuiPopover` ([#1367](https://github.com/elastic/eui/pull/1367))
- Added support for `fullWidth` on `EuiSuperSelect` ([#1367](https://github.com/elastic/eui/pull/1367))
- Applied new scrollbar customization for Firefox ([#1367](https://github.com/elastic/eui/pull/1367))
- Fixed `EuiSuperSelect` from accessing ref when unmounted ([1369](https://github.com/elastic/eui/pull/1369))

## [`5.7.0`](https://github.com/elastic/eui/tree/v5.7.0)

Expand Down
11 changes: 11 additions & 0 deletions src/components/form/super_select/super_select.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ export class EuiSuperSelect extends Component {
};
}

componentDidMount() {
this._isMounted = true;
}

componentWillUnmount() {
this._isMounted = false;
}

setItemNode = (node, index) => {
this.itemNodes[index] = node;
};
Expand All @@ -48,6 +56,9 @@ export class EuiSuperSelect extends Component {
);

requestAnimationFrame(() => {
if (!this._isMounted) {
return;
}
this.setState({
menuWidth: this.popoverRef.getBoundingClientRect().width - 2, // account for border not inner shadow
});
Expand Down