mirror of
https://gitcode.com/GitHub_Trending/ji/jitsi-meet.git
synced 2026-05-21 09:06:43 +00:00
fix(feedback): Scroll to the top when opening feedback dialog
This commit is contained in:
@@ -36,6 +36,10 @@ const SCORES = [
|
||||
'feedback.veryGood'
|
||||
];
|
||||
|
||||
type Scrollable = {
|
||||
scroll: Function
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of the React {@code Component} props of {@link FeedbackDialog}.
|
||||
*/
|
||||
@@ -171,6 +175,12 @@ class FeedbackDialog extends Component<Props, State> {
|
||||
this._onScoreContainerMouseLeave
|
||||
= this._onScoreContainerMouseLeave.bind(this);
|
||||
this._onSubmit = this._onSubmit.bind(this);
|
||||
|
||||
// On some mobile browsers opening Feedback dialog scrolls down the whole content because of the keyboard.
|
||||
// By scrolling to the top we prevent hiding the feedback stars so the user knows those exist.
|
||||
this._onScrollTop = (node: ?Scrollable) => {
|
||||
node && node.scroll && node.scroll(0, 0);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,6 +254,7 @@ class FeedbackDialog extends Component<Props, State> {
|
||||
<Dialog
|
||||
okKey = 'dialog.Submit'
|
||||
onCancel = { this._onCancel }
|
||||
onDialogRef = { this._onScrollTop }
|
||||
onSubmit = { this._onSubmit }
|
||||
titleKey = 'feedback.rateExperience'>
|
||||
<div className = 'feedback-dialog'>
|
||||
@@ -364,6 +375,8 @@ class FeedbackDialog extends Component<Props, State> {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
_onScrollTop: (node: ?Scrollable) => void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user