Make WordPress Core

Changeset 55134


Ignore:
Timestamp:
01/24/2023 09:11:47 PM (23 months ago)
Author:
audrasjb
Message:

Code Modernization: Fix a JS error in wpdialog.

This changeset replaces this.element._trigger('focus'); with this.element.trigger('focus'); in wpdialog to fix a JS error introduced in [55052].

Indeed, this inside the open() function of wpdialog refers to the jQuery UI widget, whereas this.element is the jQuery object of the DOM element. Thus, native jQuery methods need to be used, as _trigger is only defined on the jQuery UI widget.

Follow-up to [55052].

Props TobiasBg, audrasjb, shubham1gupta.
Fixes #56830.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/lib/dialog.js

    r55052 r55134  
    1818
    1919            // WebKit leaves focus in the TinyMCE editor unless we shift focus.
    20             this.element._trigger('focus');
     20            this.element.trigger('focus');
    2121            this._trigger('refresh');
    2222        }
Note: See TracChangeset for help on using the changeset viewer.