Make WordPress Core

Changeset 52953


Ignore:
Timestamp:
03/18/2022 08:10:43 PM (2 years ago)
Author:
davidbaumwald
Message:

Taxonomy: Consider HTML5 input types when resetting form values after adding a new tag.

When adding a new tag, the form is reset by clearing values for input[type=text] and textareas. However, the reset doesn't account for any HTML5 input types, like number or url, that may be added by plugins or themes.

This change updates the form resetting jQuery to clear any values from input types that are not hidden and neither a checkbox nor radio type.

Props stevegrunwell.
Fixes #48030.

File:
1 edited

Legend:

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

    r50547 r52953  
    156156            }
    157157
    158             $('input[type="text"]:visible, textarea:visible', form).val('');
     158            $('input:not([type="checkbox"]):not([type="radio"]):visible, textarea:visible', form).val('');
    159159        });
    160160
Note: See TracChangeset for help on using the changeset viewer.