Skip to content

Commit fb36ec6

Browse files
authored
Merge pull request #380 from 10up/fix/select-posts-label
Fix: ensure Content Picker label doesn’t display when max number of posts is reached
2 parents d4f2f22 + 35da224 commit fb36ec6

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/content-picker/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import styled from '@emotion/styled';
22
import { select } from '@wordpress/data';
33
import { useMemo } from '@wordpress/element';
44
import { __ } from '@wordpress/i18n';
5+
import { VisuallyHidden } from '@wordpress/components';
56
import { v4 as uuidv4 } from 'uuid';
67
import { ContentSearch } from '../content-search';
78
import SortableList from './SortableList';
@@ -158,15 +159,18 @@ export const ContentPicker: React.FC<ContentPickerProps> = ({
158159
options={searchOptions}
159160
/>
160161
) : (
161-
label && (
162+
label &&
163+
(hideLabelFromVision ? (
164+
<VisuallyHidden>{label}</VisuallyHidden>
165+
) : (
162166
<div
163167
style={{
164168
marginBottom: '8px',
165169
}}
166170
>
167171
{label}
168172
</div>
169-
)
173+
))
170174
)}
171175

172176
{Boolean(content?.length) && (

0 commit comments

Comments
 (0)