Assert type of domNode as HTMLElement to fix build
Signed-off-by: Sergey Shpikin <rkfg@rkfg.me>
This commit is contained in:
parent
2952c37a47
commit
ae3dcff230
1 changed files with 1 additions and 1 deletions
|
@ -259,7 +259,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
||||||
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`];
|
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`];
|
||||||
if (selectedCompletion && this.containerRef.current) {
|
if (selectedCompletion && this.containerRef.current) {
|
||||||
const domNode = ReactDOM.findDOMNode(selectedCompletion);
|
const domNode = ReactDOM.findDOMNode(selectedCompletion);
|
||||||
const offsetTop = domNode && domNode.offsetTop;
|
const offsetTop = domNode && (domNode as HTMLElement).offsetTop;
|
||||||
if (offsetTop > this.containerRef.current.scrollTop + this.containerRef.current.offsetHeight ||
|
if (offsetTop > this.containerRef.current.scrollTop + this.containerRef.current.offsetHeight ||
|
||||||
offsetTop < this.containerRef.current.scrollTop) {
|
offsetTop < this.containerRef.current.scrollTop) {
|
||||||
this.containerRef.current.scrollTop = offsetTop - this.containerRef.current.offsetTop;
|
this.containerRef.current.scrollTop = offsetTop - this.containerRef.current.offsetTop;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue