Skip to content

Commit

Permalink
Focus on active sidebar item when the selected link changes (#2548)
Browse files Browse the repository at this point in the history
  • Loading branch information
vaurdan authored Jun 7, 2024
1 parent 948e0a7 commit b4e15ee
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/content-helper/editor-sidebar.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '3dd37b291004e1292bb8');
<?php return array('dependencies' => array('react', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-dom-ready', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-plugins', 'wp-primitives', 'wp-url'), 'version' => '70fa2757325ff1587455');
2 changes: 1 addition & 1 deletion build/content-helper/editor-sidebar.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ export const ReviewModalSidebar = ( {
const activeItem = itemRefs.current[ activeIndex ];

if ( activeItem ) {
activeItem.focus();

if ( activeIndex === 0 ) {
sidebar.scrollTop = 0;
return;
Expand Down

0 comments on commit b4e15ee

Please sign in to comment.