Accessibility: Make the Tags meta box better support Input Method Editor (IME) converters.
Also, restores the keyboard interaction behavior prior to [41988] by requesting one single Enter key press to add a tag. Props ryanshoover, miyauchi. Fixes #45371. git-svn-id: https://develop.svn.wordpress.org/trunk@45227 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0152c18cd2
commit
715a65c561
@ -369,7 +369,8 @@
|
|||||||
/**
|
/**
|
||||||
* Handles pressing enter on the new tag input field.
|
* Handles pressing enter on the new tag input field.
|
||||||
*
|
*
|
||||||
* Prevents submitting the post edit form.
|
* Prevents submitting the post edit form. Uses `keypress` to take
|
||||||
|
* into account Input Method Editor (IME) converters.
|
||||||
*
|
*
|
||||||
* @since 2.9.0
|
* @since 2.9.0
|
||||||
*
|
*
|
||||||
@ -384,11 +385,6 @@
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
}
|
}
|
||||||
}).keypress( function( event ) {
|
|
||||||
if ( 13 == event.which ) {
|
|
||||||
event.preventDefault();
|
|
||||||
event.stopPropagation();
|
|
||||||
}
|
|
||||||
}).each( function( i, element ) {
|
}).each( function( i, element ) {
|
||||||
$( element ).wpTagsSuggest();
|
$( element ).wpTagsSuggest();
|
||||||
});
|
});
|
||||||
|
@ -107,6 +107,12 @@
|
|||||||
window.wp.a11y.speak( window.tagsSuggestL10n.termSelected, 'assertive' );
|
window.wp.a11y.speak( window.tagsSuggestL10n.termSelected, 'assertive' );
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
} else if ( $.ui.keyCode.ENTER === event.keyCode ) {
|
} else if ( $.ui.keyCode.ENTER === event.keyCode ) {
|
||||||
|
// If we're in the edit post Tags meta box, add the tag.
|
||||||
|
if ( window.tagBox ) {
|
||||||
|
window.tagBox.userAction = 'add';
|
||||||
|
window.tagBox.flushTags( $( this ).closest( '.tagsdiv' ) );
|
||||||
|
}
|
||||||
|
|
||||||
// Do not close Quick Edit / Bulk Edit
|
// Do not close Quick Edit / Bulk Edit
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
Loading…
Reference in New Issue
Block a user