Skip to content

Commit

Permalink
Forms: fix sidebar spacing (#41133)
Browse files Browse the repository at this point in the history
* Forms: fix spacing in sidebar

* changelog

* Fixes the form so that we ship less code but still end up with the same result

* Add key to the Select control

---------

Co-authored-by: Enej Bajgoric <[email protected]>
  • Loading branch information
2 people authored and kangzj committed Jan 17, 2025
1 parent facae61 commit e37d4ea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions projects/packages/forms/changelog/fix-forms-sidebar-spacing
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed

Forms: fix spacing issue in sidebar settings
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ function JetpackFieldCheckbox( props ) {
<PanelBody title={ __( 'Field Settings', 'jetpack-forms' ) }>
<ToggleControl
label={ __( 'Field is required', 'jetpack-forms' ) }
className="jetpack-field-label__required"
checked={ required }
onChange={ value => setAttributes( { required: value } ) }
help={ __( 'You can edit the "required" label in the editor', 'jetpack-forms' ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ const JetpackFieldControls = ( {
<ToggleControl
key="required"
label={ __( 'Field is required', 'jetpack-forms' ) }
className="jetpack-field-label__required"
checked={ required }
onChange={ value => setAttributes( { required: value } ) }
help={ __( 'You can edit the "required" label in the editor', 'jetpack-forms' ) }
Expand Down Expand Up @@ -170,9 +169,7 @@ const JetpackFieldControls = ( {
<JetpackManageResponsesSettings isChildBlock />
</PanelBody>
<PanelBody title={ __( 'Field Settings', 'jetpack-forms' ) }>
{ fieldSettings.filter( Boolean ).map( ( elt, index ) => (
<div key={ index }>{ elt }</div>
) ) }
<>{ fieldSettings }</>
</PanelBody>
<PanelColorSettings
title={ __( 'Color', 'jetpack-forms' ) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const JetpackDatePicker = props => {
index: 1,
element: (
<SelectControl
key="date-format"
label={ __( 'Date Format', 'jetpack-forms' ) }
options={ DATE_FORMATS.map( ( { value, label: optionLabel, example } ) => ( {
value,
Expand Down
10 changes: 0 additions & 10 deletions projects/packages/forms/src/blocks/contact-form/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -267,16 +267,6 @@
.components-base-control {
margin-top: -1px;
margin-bottom: -3px;

&.jetpack-field-label__required {
.components-form-toggle {
margin: 2px 8px 0 16px;
}

.components-toggle-control__label {
word-break: normal;
}
}
}

.rich-text.jetpack-field-label__input {
Expand Down

0 comments on commit e37d4ea

Please sign in to comment.