Skip to content

Commit

Permalink
No keyboardReturn on edit
Browse files Browse the repository at this point in the history
Also fixes spinner on the internal url input
  • Loading branch information
richtabor authored and getdave committed Aug 8, 2023
1 parent 7434c99 commit b98f214
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
21 changes: 12 additions & 9 deletions packages/block-editor/src/components/link-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ function LinkControl( {
className={ classnames( {
'block-editor-link-control__search-input-wrapper': true,
'has-text-control': showTextControl,
'has-actions': showActions,
} ) }
>
{ showTextControl && (
Expand Down Expand Up @@ -392,15 +393,17 @@ function LinkControl( {
}
hideLabelFromVision={ ! showTextControl }
/>
<div className="block-editor-link-control__search-enter">
<Button
onClick={ isDisabled ? noop : handleSubmit }
label={ __( 'Submit' ) }
icon={ keyboardReturn }
className="block-editor-link-control__search-submit"
aria-disabled={ isDisabled }
/>
</div>
{ ! showActions && (
<div className="block-editor-link-control__search-enter">
<Button
onClick={ isDisabled ? noop : handleSubmit }
label={ __( 'Submit' ) }
icon={ keyboardReturn }
className="block-editor-link-control__search-submit"
aria-disabled={ isDisabled }
/>
</div>
) }
</div>
{ errorMessage && (
<Notice
Expand Down
8 changes: 7 additions & 1 deletion packages/block-editor/src/components/link-control/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ $preview-image-height: 140px;
}

// Provides positioning context for search actions
.block-editor-link-control__search-input-container {
.block-editor-link-control__search-input-container,
.block-editor-link-control__search-input-wrapper {
position: relative;
}

Expand Down Expand Up @@ -458,6 +459,11 @@ $preview-image-height: 140px;
}
}

.block-editor-link-control .block-editor-link-control__search-input-wrapper.has-actions .components-spinner {
top: calc(50% + #{$spinner-size} / 4); // Add top spacing because this input has a visual label.
right: $grid-unit-15;
}

.block-editor-link-control__search-item-action {
margin-left: auto; // push to far right hand side
flex-shrink: 0;
Expand Down

0 comments on commit b98f214

Please sign in to comment.