Merge pull request #4688 from matrix-org/t3chguy/autocomplete-scrollintoview

add null-guard for Autocomplete containerRef
pull/21833/head
Michael Telatynski 2020-06-03 10:59:14 +01:00 committed by GitHub
commit 6d11b4f99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -260,7 +260,7 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
behavior: "auto", behavior: "auto",
block: "nearest", block: "nearest",
}); });
} else { } else if (this.containerRef.current) {
this.containerRef.current.scrollTo({ top: 0 }); this.containerRef.current.scrollTo({ top: 0 });
} }
} }