mirror of https://github.com/vector-im/riot-web
Assert type of domNode as HTMLElement to fix build
Signed-off-by: Sergey Shpikin <rkfg@rkfg.me>pull/21833/head
parent
2952c37a47
commit
ae3dcff230
|
@ -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…
Reference in New Issue