Add ref to callViewWrapper

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner 2021-05-03 15:40:59 +02:00
parent 76f503666c
commit 2c9231641b
No known key found for this signature in database
GPG key ID: 9760693FDD98A790

View file

@ -15,7 +15,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
import React from 'react'; import React, { createRef } from 'react';
import CallView from "./CallView"; import CallView from "./CallView";
import RoomViewStore from '../../../stores/RoomViewStore'; import RoomViewStore from '../../../stores/RoomViewStore';
@ -122,6 +122,8 @@ export default class CallPreview extends React.Component<IProps, IState> {
}; };
} }
private callViewWrapper = createRef<HTMLDivElement>();
private initX = 0; private initX = 0;
private initY = 0; private initY = 0;
private lastX = DEFAULT_X_OFFSET; private lastX = DEFAULT_X_OFFSET;
@ -230,7 +232,11 @@ export default class CallPreview extends React.Component<IProps, IState> {
}; };
return ( return (
<div className="mx_CallPreview" style={style}> <div
className="mx_CallPreview"
style={style}
ref={this.callViewWrapper}
>
<CallView <CallView
call={this.state.primaryCall} call={this.state.primaryCall}
secondaryCall={this.state.secondaryCall} secondaryCall={this.state.secondaryCall}