Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/dataviews/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### Bug Fixes

- DataForm: Fix label color of array control. [#75730](https://github.com/WordPress/gutenberg/pull/75730)
- DataForm: Fix `card` layout's toggle button screen reader text. [#76039](https://github.com/WordPress/gutenberg/pull/76039)
- DataViews: Fix focus transfer while searching in `list` layout. [#75999](https://github.com/WordPress/gutenberg/pull/75999)
- DataForm: Fix focus loss when collapsing in Card view. [#75689](https://github.com/WordPress/gutenberg/pull/75689)
- DataViews: Avoid flickering while refreshing. [#74572](https://github.com/WordPress/gutenberg/pull/74572)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
useRef,
useState,
} from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { chevronDown, chevronUp } from '@wordpress/icons';

/**
Expand Down Expand Up @@ -103,6 +102,10 @@ export default function FormCardField< Item >( {
FormCardField,
'dataforms-layouts-card-card-body'
);
const titleId = useInstanceId(
FormCardField,
'dataforms-layouts-card-card-title'
);
Comment thread
ntsekouras marked this conversation as resolved.
Outdated

const form: NormalizedForm = useMemo(
() => ( {
Expand Down Expand Up @@ -240,7 +243,10 @@ export default function FormCardField< Item >( {
alignItems: 'center',
} }
>
<span className="dataforms-layouts-card__field-header-label">
<span
id={ titleId }
className="dataforms-layouts-card__field-header-label"
>
{ label }
</span>
{ validationBadge }
Expand All @@ -266,9 +272,7 @@ export default function FormCardField< Item >( {
icon={ isOpen ? chevronUp : chevronDown }
aria-expanded={ isOpen }
aria-controls={ bodyId }
aria-label={
isOpen ? __( 'Collapse' ) : __( 'Expand' )
}
aria-labelledby={ titleId }
/>
) }
</OriginalCardHeader>
Expand Down
Loading