Skip to content

Commit 7ff7553

Browse files
committed
Comments: Prevent AYS prompt when replying to a comment and nothing has been entered.
When replying to a comment and nothing has yet been entered for the reply content, clicking "Reply" or "Quick Edit" on another comment presents the "Are you sure..." prompt indicating there are unsaved changes in the reply content. However, if nothing is entered, this prompt should not be displayed. This change implements a new check to determine if any text has been entered by the user before deciding to show the "Are you sure..." prompt. Props cu121, mkox, azouamauriac, hasanuzzamanshamim, pls78, faisal03, rafiahmedd. Fixes #54990. git-svn-id: https://develop.svn.wordpress.org/trunk@54334 602fd350-edb4-49c9-b593-d223f7449a82
1 parent f9769f5 commit 7ff7553

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/js/_enqueues/admin/edit-comments.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ window.commentReply = {
12251225
discardCommentChanges: function() {
12261226
var editRow = $( '#replyrow' );
12271227

1228-
if ( this.originalContent === $( '#replycontent', editRow ).val() ) {
1228+
if ( '' === $( '#replycontent', editRow ).val() || this.originalContent === $( '#replycontent', editRow ).val() ) {
12291229
return true;
12301230
}
12311231

0 commit comments

Comments
 (0)