From 6328a60301d8439735a57121f27d31edd4de3f74 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Mon, 20 Apr 2020 19:02:27 +0100 Subject: [PATCH] improve member name Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/Autocomplete.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/views/rooms/Autocomplete.tsx b/src/components/views/rooms/Autocomplete.tsx index d4fcc5852b..68d82f0bc3 100644 --- a/src/components/views/rooms/Autocomplete.tsx +++ b/src/components/views/rooms/Autocomplete.tsx @@ -65,7 +65,7 @@ export default class Autocomplete extends React.PureComponent { autocompleter: Autocompleter; queryRequested: string; debounceCompletionsRequest: NodeJS.Timeout; - container: React.RefObject; + containerRef: React.RefObject; constructor(props) { super(props); @@ -90,7 +90,7 @@ export default class Autocomplete extends React.PureComponent { forceComplete: false, }; - this.container = React.createRef(); + this.containerRef = React.createRef(); } componentDidMount() { @@ -268,12 +268,12 @@ export default class Autocomplete extends React.PureComponent { 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}`]; - if (selectedCompletion && this.container.current) { + if (selectedCompletion && this.containerRef.current) { const domNode = ReactDOM.findDOMNode(selectedCompletion); const offsetTop = domNode && domNode.offsetTop; - if (offsetTop > this.container.current.scrollTop + this.container.current.offsetHeight || - offsetTop < this.container.current.scrollTop) { - this.container.current.scrollTop = offsetTop - this.container.current.offsetTop; + if (offsetTop > this.containerRef.current.scrollTop + this.containerRef.current.offsetHeight || + offsetTop < this.containerRef.current.scrollTop) { + this.containerRef.current.scrollTop = offsetTop - this.containerRef.current.offsetTop; } } } @@ -311,7 +311,7 @@ export default class Autocomplete extends React.PureComponent { }).filter((completion) => !!completion); return !this.state.hide && renderedCompletions.length > 0 ? ( -
+
{ renderedCompletions }
) : null;