Make WordPress Core

Changeset 53168


Ignore:
Timestamp:
04/12/2022 07:35:26 PM (23 months ago)
Author:
davidbaumwald
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/js/_enqueues/admin/tags.js

    r53088 r53168  
    159159            }
    160160
    161             $('input:not([type="checkbox"]):not([type="radio"]):visible, textarea:visible', form).val('');
     161            $('input:not([type="checkbox"]):not([type="radio"]):not([type="button"]):not([type="submit"]):not([type="reset"]):visible, textarea:visible', form).val('');
    162162        });
    163163
Note: See TracChangeset for help on using the changeset viewer.