[wp-trac] [WordPress Trac] #47018: No error message provided upon incomplete input in Tags Administration Screen
WordPress Trac
noreply at wordpress.org
Thu Apr 7 10:05:50 UTC 2022
#47018: No error message provided upon incomplete input in Tags Administration
Screen
-------------------------------------+-------------------------------------
Reporter: conner_bw | Owner: peterwilsoncc
Type: enhancement | Status: reopened
Priority: normal | Milestone: 6.0
Component: Taxonomy | Version: 5.1.1
Severity: normal | Resolution:
Keywords: has-screenshots input- | Focuses: ui, accessibility,
validation has-patch | javascript, administration
-------------------------------------+-------------------------------------
Changes (by afercia):
* keywords: has-screenshots input-validation has-patch needs-testing =>
has-screenshots input-validation has-patch
* status: closed => reopened
* resolution: fixed =>
Comment:
@peterwilsoncc thanks for your review and commit. I'm going to reopen this
ticket because there are a few things I'd like to bring in for some better
consideration.
1
> removed the new `wp-a11y` dependency for inclusion in #55537.
The `ajax-response.js` script already contains two calls to
`wp.a11y.speak`. They were added in a previous commit, see [52170].
However, that change missed to add the `wp-a11y` dependency. That's unsafe
and should be fixed. There's no guarantee that #55537 will make it for
6.0. The dependency should have been kept or at least a new ticket should
have been created.
2
> `validateForm` is used throughout the admin so trimming could cause
false errors on other forms
I'm not sure that's correct. In core, there are two JavaScript functions
named `validateForm`:
- `window.validateForm` in `common.js`
- `window.wpAjax.validateForm` in `ajax-response.js`
The first one is used here in `tags.js`. I couldn't find any other usage
in core. I think it's safe to add `trim()`. If we don't, submitting the
form with the 'Name' field that contains only spaces will display an admin
notice at the top of the page but the red border will not be added to the
input field. I'm not sure that would be a good experience for users. See
attached screenshot.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/47018#comment:27>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list