Skip to content

Commit bbd067c

Browse files
committed
Revert aria-expanded change in cdd92a6
1 parent 6a49945 commit bbd067c

2 files changed

Lines changed: 20 additions & 54 deletions

File tree

packages/block-editor/src/components/block-visibility/viewport-toolbar.js

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,27 @@ import { unlock } from '../../lock-unlock';
1616

1717
export default function BlockVisibilityViewportToolbar( { clientIds } ) {
1818
const hasBlockVisibilityButtonShownRef = useRef( false );
19-
const { canToggleBlockVisibility, areBlocksHiddenAnywhere, isModalOpen } =
20-
useSelect(
21-
( select ) => {
22-
const {
23-
getBlocksByClientId,
24-
getBlockName,
25-
isBlockHiddenAnywhere,
26-
getViewportModalClientIds,
27-
} = unlock( select( blockEditorStore ) );
28-
const _blocks = getBlocksByClientId( clientIds );
29-
return {
30-
canToggleBlockVisibility: _blocks.every( ( { clientId } ) =>
31-
hasBlockSupport(
32-
getBlockName( clientId ),
33-
'visibility',
34-
true
35-
)
36-
),
37-
areBlocksHiddenAnywhere: clientIds?.every( ( clientId ) =>
38-
isBlockHiddenAnywhere( clientId )
39-
),
40-
isModalOpen: getViewportModalClientIds() !== null,
41-
};
42-
},
19+
const { canToggleBlockVisibility, areBlocksHiddenAnywhere } = useSelect(
20+
( select ) => {
21+
const { getBlocksByClientId, getBlockName, isBlockHiddenAnywhere } =
22+
unlock( select( blockEditorStore ) );
23+
const _blocks = getBlocksByClientId( clientIds );
24+
return {
25+
canToggleBlockVisibility: _blocks.every( ( { clientId } ) =>
26+
hasBlockSupport(
27+
getBlockName( clientId ),
28+
'visibility',
29+
true
30+
)
31+
),
32+
areBlocksHiddenAnywhere: clientIds?.every( ( clientId ) =>
33+
isBlockHiddenAnywhere( clientId )
34+
),
35+
};
36+
},
4337

44-
[ clientIds ]
45-
);
38+
[ clientIds ]
39+
);
4640
const blockEditorDispatch = useDispatch( blockEditorStore );
4741

4842
/*
@@ -76,7 +70,6 @@ export default function BlockVisibilityViewportToolbar( { clientIds } ) {
7670
areBlocksHiddenAnywhere ? __( 'Hidden' ) : __( 'Visible' )
7771
}
7872
onClick={ () => showViewportModal( clientIds ) }
79-
aria-expanded={ isModalOpen }
8073
aria-haspopup="dialog"
8174
/>
8275
</ToolbarGroup>

packages/block-editor/src/store/private-selectors.js

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -989,33 +989,6 @@ export function getListViewExpandRevision( state ) {
989989
return state.listViewExpandRevision || 0;
990990
}
991991

992-
/**
993-
* Returns whether a List View panel is opened.
994-
*
995-
* @param {Object} state Global application state.
996-
* @param {string} clientId Client ID of the block.
997-
*
998-
* @return {boolean} Whether the panel is opened.
999-
*/
1000-
export function isListViewPanelOpened( state, clientId ) {
1001-
// If allOpen flag is set, all panels are open
1002-
if ( state.openedListViewPanels?.allOpen ) {
1003-
return true;
1004-
}
1005-
return state.openedListViewPanels?.panels?.[ clientId ] === true;
1006-
}
1007-
1008-
/**
1009-
* Returns the List View expand revision number.
1010-
*
1011-
* @param {Object} state Global application state.
1012-
*
1013-
* @return {number} The expand revision number.
1014-
*/
1015-
export function getListViewExpandRevision( state ) {
1016-
return state.listViewExpandRevision || 0;
1017-
}
1018-
1019992
/**
1020993
* Returns the client IDs for the viewport modal, or null if
1021994
* the modal is not open.

0 commit comments

Comments
 (0)