From 4643bb45e070b8e8674abf75e99abccc3c0baf49 Mon Sep 17 00:00:00 2001 From: Jb Audras Date: Tue, 24 Jan 2023 21:11:47 +0000 Subject: [PATCH] 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. git-svn-id: https://develop.svn.wordpress.org/trunk@55134 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/lib/dialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/lib/dialog.js b/src/js/_enqueues/lib/dialog.js index eb7af5e6e3..0da56f53ac 100644 --- a/src/js/_enqueues/lib/dialog.js +++ b/src/js/_enqueues/lib/dialog.js @@ -17,7 +17,7 @@ this._super(); // WebKit leaves focus in the TinyMCE editor unless we shift focus. - this.element._trigger('focus'); + this.element.trigger('focus'); this._trigger('refresh'); } });