Skip to content

Commit

Permalink
CommentsField: prevent page to scroll to input on load
Browse files Browse the repository at this point in the history
  • Loading branch information
srosset81 committed Dec 8, 2022
1 parent a3902b6 commit 1183b6f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const PostCommentForm = ({ context, helperText, mentions, userResource, addItem,
// TODO When we update to React-Admin 4, check if the new RichTextInput solves this bug
if (pristine) {
const commentElement = document.getElementById('comment');
if (commentElement) commentElement.innerHTML = '';
if (commentElement && commentElement.textContent !== '') commentElement.innerHTML = '';
}
return (
<form onSubmit={handleSubmit} className={classes.form}>
Expand Down

0 comments on commit 1183b6f

Please sign in to comment.