| 368 | } |
| 369 | } |
| 370 | componentDidMount() { |
| 371 | const size = (0, _sanddanceReact.SandDance).VegaDeckGl.util.outerSize(this.div); |
| 372 | const over = { |
| 373 | left: Math.max(0, this.state.left + size.width - this.props.container.offsetWidth), |
| 374 | top: Math.max(0, this.state.top + size.height - this.props.container.offsetHeight) |
| 375 | }; |
| 376 | if (over.left || over.top) { |
| 377 | let { left , top } = this.state; |
| 378 | left -= over.left; |
| 379 | top -= over.top; |
| 380 | this.setState({ |
| 381 | left, |
| 382 | top |
| 383 | }); |
| 384 | } else this.focus(); |
| 385 | } |
| 386 | componentDidUpdate() { |
| 387 | this.focus(); |
| 388 | } |