Skip to content

Commit 1affaec

Browse files
committed
fix: disable focus for inactive arrow buttons
1 parent c916691 commit 1affaec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/js/_enqueues/admin/postbox.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,11 @@
217217
// Enable all buttons as a reset first.
218218
moveUpButtons
219219
.attr( 'aria-disabled', 'false' )
220+
.prop( 'disabled', false )
220221
.removeClass( 'hidden' );
221222
moveDownButtons
222223
.attr( 'aria-disabled', 'false' )
224+
.prop( 'disabled', false )
223225
.removeClass( 'hidden' );
224226

225227
// When there's only one "sortables" area (e.g. in the block editor) and only one visible postbox, hide the buttons.
@@ -230,12 +232,16 @@
230232

231233
// Set an aria-disabled=true attribute on the first visible "move" buttons.
232234
if ( firstSortablesId === firstPostboxSortablesId ) {
233-
$( firstPostbox ).find( '.handle-order-higher' ).attr( 'aria-disabled', 'true' );
235+
$( firstPostbox ).find( '.handle-order-higher' )
236+
.attr( 'aria-disabled', 'true' )
237+
.prop( 'disabled', true );
234238
}
235239

236240
// Set an aria-disabled=true attribute on the last visible "move" buttons.
237241
if ( lastSortablesId === lastPostboxSortablesId ) {
238-
$( '.postbox:visible .handle-order-lower' ).last().attr( 'aria-disabled', 'true' );
242+
$( '.postbox:visible .handle-order-lower' ).last()
243+
.attr( 'aria-disabled', 'true' )
244+
.prop( 'disabled', true );
239245
}
240246
},
241247

0 commit comments

Comments
 (0)