@@ -334,8 +334,6 @@ function LinkControl( {
334
334
335
335
const showActions = isEditingLink && hasLinkValue ;
336
336
337
- const showURLInput = hasLinkValue && ! value ?. id ;
338
-
339
337
// Only show text control once a URL value has been committed
340
338
// and it isn't just empty whitespace.
341
339
// See https://github.com/WordPress/gutenberg/pull/33849/#issuecomment-932194927.
@@ -401,18 +399,6 @@ function LinkControl( {
401
399
'has-actions' : showActions ,
402
400
} ) }
403
401
>
404
- { showURLInput && (
405
- < TextControl
406
- __nextHasNoMarginBottom
407
- className = "block-editor-link-control__field block-editor-link-control__search-input"
408
- label = { __ ( 'Link' ) }
409
- value = { currentUrlInputValue }
410
- onChange = { setInternalURLInputValue }
411
- onKeyDown = { handleSubmitWithEnter }
412
- size = "__unstable-large"
413
- />
414
- ) }
415
-
416
402
{ showTextControl && (
417
403
< TextControl
418
404
__nextHasNoMarginBottom
@@ -426,45 +412,35 @@ function LinkControl( {
426
412
/>
427
413
) }
428
414
429
- { ! hasLinkValue && (
430
- < >
431
- < LinkControlSearchInput
432
- currentLink = { value }
433
- className = "block-editor-link-control__field block-editor-link-control__search-input"
434
- placeholder = { searchInputPlaceholder }
435
- value = { currentUrlInputValue }
436
- withCreateSuggestion = {
437
- withCreateSuggestion
438
- }
439
- onCreateSuggestion = { createPage }
440
- onChange = { setInternalURLInputValue }
441
- onSelect = { handleSelectSuggestion }
442
- showInitialSuggestions = {
443
- showInitialSuggestions
444
- }
445
- allowDirectEntry = { ! noDirectEntry }
446
- showSuggestions = { showSuggestions }
447
- suggestionsQuery = { suggestionsQuery }
448
- withURLSuggestion = { ! noURLSuggestion }
449
- createSuggestionButtonText = {
450
- createSuggestionButtonText
451
- }
452
- hideLabelFromVision = { ! showTextControl }
415
+ < LinkControlSearchInput
416
+ currentLink = { value }
417
+ className = "block-editor-link-control__field block-editor-link-control__search-input"
418
+ placeholder = { searchInputPlaceholder }
419
+ value = { currentUrlInputValue }
420
+ withCreateSuggestion = { withCreateSuggestion }
421
+ onCreateSuggestion = { createPage }
422
+ onChange = { setInternalURLInputValue }
423
+ onSelect = { handleSelectSuggestion }
424
+ showInitialSuggestions = { showInitialSuggestions }
425
+ allowDirectEntry = { ! noDirectEntry }
426
+ showSuggestions = { showSuggestions }
427
+ suggestionsQuery = { suggestionsQuery }
428
+ withURLSuggestion = { ! noURLSuggestion }
429
+ createSuggestionButtonText = {
430
+ createSuggestionButtonText
431
+ }
432
+ hideLabelFromVision = { ! showTextControl }
433
+ />
434
+ { ! showActions && (
435
+ < div className = "block-editor-link-control__search-enter" >
436
+ < Button
437
+ onClick = { isDisabled ? noop : handleSubmit }
438
+ label = { __ ( 'Submit' ) }
439
+ icon = { keyboardReturn }
440
+ className = "block-editor-link-control__search-submit"
441
+ aria-disabled = { isDisabled }
453
442
/>
454
- { ! showActions && (
455
- < div className = "block-editor-link-control__search-enter" >
456
- < Button
457
- onClick = {
458
- isDisabled ? noop : handleSubmit
459
- }
460
- label = { __ ( 'Submit' ) }
461
- icon = { keyboardReturn }
462
- className = "block-editor-link-control__search-submit"
463
- aria-disabled = { isDisabled }
464
- />
465
- </ div >
466
- ) }
467
- </ >
443
+ </ div >
468
444
) }
469
445
</ div >
470
446
{ errorMessage && (
0 commit comments