Make WordPress Core

Changeset 54334

Timestamp:
09/27/2022 05:04:39 PM (23 months ago)
Author:
davidbaumwald
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/edit-comments.js

    r52951 r54334  
    12261226        var editRow = $( '#replyrow' );
    12271227
    1228         if  ( this.originalContent === $( '#replycontent', editRow ).val() ) {
     1228        if  ( this.originalContent === $( '#replycontent', editRow ).val() ) {
    12291229            return true;
    12301230        }
Note: See TracChangeset for help on using the changeset viewer.