There was an error while loading. Please reload this page.
1 parent 669d2c4 commit 3b797e1Copy full SHA for 3b797e1
1 file changed
src/DepartmentSingleSelectEditor/pc-editor/index.js
@@ -35,10 +35,15 @@ class PCDepartmentSingleSelectEditor extends Component {
35
36
componentDidMount() {
37
if (this.isRowExpand) {
38
- if (this.outerRef.getBoundingClientRect().top > 330) {
39
- const menuStyle = { top: -200 };
40
- this.setState({ menuStyle });
+ let menuStyle = {};
+ const { top, left } = this.outerRef.getBoundingClientRect();
+ if (top > 330) {
41
+ menuStyle.top = -200;
42
}
43
+ if (left > window.innerWidth - 300) {
44
+ menuStyle.left = left - window.innerWidth;
45
+ }
46
+ this.setState({ menuStyle });
47
48
49
0 commit comments