From 2e4661c6c9193a1cd68cc2d113ef7ebea693375a Mon Sep 17 00:00:00 2001 From: David Baumwald Date: Tue, 12 Apr 2022 19:35:26 +0000 Subject: [PATCH] Taxonomy: Only reset non-button form field values after adding a tag. [52953] added HTML5 input types to the form reset after a tag is created. The selector was a bit too greedy, causing `button` types to have their values reset also. This change updates the jQuery selector to exclude `button`, `submit`, and `reset` input types from the form reset. Follow-up to [52953]. Props peterwilsoncc. Fixes #48030. git-svn-id: https://develop.svn.wordpress.org/trunk@53168 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/admin/tags.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/_enqueues/admin/tags.js b/src/js/_enqueues/admin/tags.js index 474088646e..2e55e2ed20 100644 --- a/src/js/_enqueues/admin/tags.js +++ b/src/js/_enqueues/admin/tags.js @@ -158,7 +158,7 @@ jQuery( function($) { form.find( 'select#parent option:selected' ).after( '' ); } - $('input:not([type="checkbox"]):not([type="radio"]):visible, textarea:visible', form).val(''); + $('input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):visible, textarea:visible', form).val(''); }); return false;