diff --git a/packages/dataviews/src/dataform-controls/datetime.tsx b/packages/dataviews/src/dataform-controls/datetime.tsx index 3ba22dc0c1b089..b31c5c60bb9c6e 100644 --- a/packages/dataviews/src/dataform-controls/datetime.tsx +++ b/packages/dataviews/src/dataform-controls/datetime.tsx @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { BaseControl, TimePicker } from '@wordpress/components'; +import { BaseControl, TimePicker, VisuallyHidden } from '@wordpress/components'; import { useCallback } from '@wordpress/element'; /** @@ -13,6 +13,7 @@ export default function DateTime< Item >( { data, field, onChange, + hideLabelFromVision, }: DataFormControlProps< Item > ) { const { id, label } = field; const value = field.getValue( { item: data } ); @@ -23,10 +24,15 @@ export default function DateTime< Item >( { ); return ( -
- - { label } - +
+ { ! hideLabelFromVision && ( + + { label } + + ) } + { hideLabelFromVision && ( + { label } + ) }