Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextareaControl: add new opt-in prop #46559

Merged
merged 4 commits into from
Dec 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ export default function CoverInspectorControls( {
isImageBackground &&
isImgElement && (
<TextareaControl
__nextHasNoMarginBottom
label={ __(
'Alt text (alternative text)'
) }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/image/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ export default function Image( {
<PanelBody title={ __( 'Settings' ) }>
{ ! multiImageSelection && (
<TextareaControl
__nextHasNoMarginBottom
label={ __( 'Alt text (alternative text)' ) }
value={ alt }
onChange={ updateAlt }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/media-text/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function MediaTextEdit( { attributes, isSelected, setAttributes, clientId } ) {
) }
{ mediaType === 'image' && (
<TextareaControl
__nextHasNoMarginBottom
label={ __( 'Alt text (alternative text)' ) }
value={ mediaAlt }
onChange={ onMediaAltChange }
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-link/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@ export default function NavigationLinkEdit( {
autoComplete="off"
/>
<TextareaControl
__nextHasNoMarginBottom
value={ description || '' }
onChange={ ( descriptionValue ) => {
setAttributes( { description: descriptionValue } );
Expand Down
1 change: 1 addition & 0 deletions packages/block-library/src/navigation-submenu/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ export default function NavigationSubmenuEdit( {
autoComplete="off"
/>
<TextareaControl
__nextHasNoMarginBottom
value={ description || '' }
onChange={ ( descriptionValue ) => {
setAttributes( {
Expand Down
8 changes: 6 additions & 2 deletions packages/components/src/disabled/stories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Disabled from '../';
import SelectControl from '../../select-control/';
import TextControl from '../../text-control/';
import TextareaControl from '../../textarea-control/';
import { VStack } from '../../v-stack/';

const meta: ComponentMeta< typeof Disabled > = {
title: 'Components/Disabled',
Expand All @@ -37,18 +38,21 @@ const Form = () => {
const [ textControlValue, setTextControlValue ] = useState( '' );
const [ textAreaValue, setTextAreaValue ] = useState( '' );
return (
<div>
<VStack>
<TextControl
__nextHasNoMarginBottom
label="Text Control"
value={ textControlValue }
onChange={ setTextControlValue }
/>
<TextareaControl
__nextHasNoMarginBottom
label="TextArea Control"
value={ textAreaValue }
onChange={ setTextAreaValue }
/>
<SelectControl
__nextHasNoMarginBottom
label="Select Control"
onChange={ () => {} }
options={ [
Expand All @@ -58,7 +62,7 @@ const Form = () => {
{ value: 'c', label: 'Option C' },
] }
/>
</div>
</VStack>
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function CustomCSSControl() {
return (
<>
<TextareaControl
__nextHasNoMarginBottom
value={
customCSS?.replace( ignoreThemeCustomCSS, '' ) ||
themeCustomCSS
Expand Down
1 change: 1 addition & 0 deletions packages/editor/src/components/post-excerpt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ function PostExcerpt( { excerpt, onUpdateExcerpt } ) {
return (
<div className="editor-post-excerpt">
<TextareaControl
__nextHasNoMarginBottom
label={ __( 'Write an excerpt (optional)' ) }
className="editor-post-excerpt__textarea"
onChange={ ( value ) => onUpdateExcerpt( value ) }
Expand Down