From 17a4dcb3032a253c8c33d0b768eb891de2a67eb7 Mon Sep 17 00:00:00 2001 From: Joe Dolson Date: Wed, 8 Feb 2023 19:38:50 +0000 Subject: [PATCH] Media: Fix focus loss updating custom fields in media modal. When the save action runs to dynamically save changes to custom fields in the media modal, the custom fields container is re-rendered, losing focus. Remove the re-rendering of custom fields to prevent loss of focus. Props lucymtc, teebee, syhc, afrin29, antpb, joedolson. Fixes #40909. git-svn-id: https://develop.svn.wordpress.org/trunk@55299 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/media/views/attachment-compat.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/js/media/views/attachment-compat.js b/src/js/media/views/attachment-compat.js index c58755d227..c0106bb8df 100644 --- a/src/js/media/views/attachment-compat.js +++ b/src/js/media/views/attachment-compat.js @@ -24,9 +24,6 @@ AttachmentCompat = View.extend(/** @lends wp.media.view.AttachmentCompat.prototy 'change textarea': 'save' }, - initialize: function() { - this.listenTo( this.model, 'change:compat', this.render ); - }, /** * @return {wp.media.view.AttachmentCompat} Returns itself to allow chaining. */