From 380ef3da0b0c8df20977a21d69ce41a5e78c6d36 Mon Sep 17 00:00:00 2001 From: Vlad Piersec Date: Wed, 15 Sep 2021 11:13:05 +0300 Subject: [PATCH] fix(feedback): Scroll to the top when opening feedback dialog --- .../dialog/components/web/StatelessDialog.js | 25 +++++++++++-------- .../feedback/components/FeedbackDialog.web.js | 13 ++++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/react/features/base/dialog/components/web/StatelessDialog.js b/react/features/base/dialog/components/web/StatelessDialog.js index ad3b94ec3..f656850c6 100644 --- a/react/features/base/dialog/components/web/StatelessDialog.js +++ b/react/features/base/dialog/components/web/StatelessDialog.js @@ -28,8 +28,7 @@ const OK_BUTTON_ID = 'modal-dialog-ok-button'; * * @static */ -type Props = { - ...DialogProps, +type Props = DialogProps & { /** * Custom dialog header that replaces the standard heading. @@ -77,6 +76,11 @@ type Props = { */ onDecline?: Function, + /** + * Callback invoked when setting the ref of the Dialog. + */ + onDialogRef?: Function, + /** * Disables rendering of the submit button. */ @@ -127,7 +131,7 @@ class StatelessDialog extends Component { this._onKeyPress = this._onKeyPress.bind(this); this._onSubmit = this._onSubmit.bind(this); this._renderFooter = this._renderFooter.bind(this); - this._setDialogElement = this._setDialogElement.bind(this); + this._onDialogRef = this._onDialogRef.bind(this); } /** @@ -166,7 +170,7 @@ class StatelessDialog extends Component { width = { width || 'medium' }>
+ ref = { this._onDialogRef }>