You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-14 19:02:33 +03:00
tidy up the ref to ref with a forwardRef and initialComponent signature
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -23,7 +23,6 @@ import {Room} from 'matrix-js-sdk/src/models/room';
|
||||
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import Autocompleter from '../../../autocomplete/Autocompleter';
|
||||
import { Completion } from '../../../autocomplete/Components';
|
||||
|
||||
const COMPOSER_SELECTED = 0;
|
||||
|
||||
@@ -254,10 +253,10 @@ export default class Autocomplete extends React.PureComponent<IProps, IState> {
|
||||
componentDidUpdate(prevProps: IProps) {
|
||||
this.applyNewProps(prevProps.query, prevProps.room);
|
||||
// this is the selected completion, so scroll it into view if needed
|
||||
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`] as Completion<any>;
|
||||
const selectedCompletion = this.refs[`completion${this.state.selectionOffset}`] as HTMLElement;
|
||||
|
||||
if (selectedCompletion && selectedCompletion.nodeRef.current) {
|
||||
selectedCompletion.nodeRef.current.scrollIntoView({
|
||||
if (selectedCompletion) {
|
||||
selectedCompletion.scrollIntoView({
|
||||
behavior: "auto",
|
||||
block: "nearest",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user