@@ -5,13 +5,14 @@ import type {
55 UmbLinkPickerModalValue ,
66} from './link-picker-modal.token.js' ;
77import { css , customElement , html , nothing , query , state , when } from '@umbraco-cms/backoffice/external/lit' ;
8+ import { isUmbracoFolder , UmbMediaTypeStructureRepository } from '@umbraco-cms/backoffice/media-type' ;
9+ import { umbFocus } from '@umbraco-cms/backoffice/lit-element' ;
810import { UmbDocumentDetailRepository } from '@umbraco-cms/backoffice/document' ;
911import { UmbMediaDetailRepository } from '@umbraco-cms/backoffice/media' ;
1012import { UmbModalBaseElement } from '@umbraco-cms/backoffice/modal' ;
1113import type { UmbInputDocumentElement } from '@umbraco-cms/backoffice/document' ;
1214import type { UmbInputMediaElement } from '@umbraco-cms/backoffice/media' ;
1315import type { UUIBooleanInputEvent , UUIInputEvent } from '@umbraco-cms/backoffice/external/uui' ;
14- import { isUmbracoFolder , UmbMediaTypeStructureRepository } from '@umbraco-cms/backoffice/media-type' ;
1516
1617type UmbInputPickerEvent = CustomEvent & { target : { value ?: string } } ;
1718
@@ -56,8 +57,10 @@ export class UmbLinkPickerModalElement extends UmbModalBaseElement<UmbLinkPicker
5657
5758 if ( query . includes ( '=' ) ) {
5859 this . #partialUpdateLink( { queryString : `?${ query } ` } ) ;
59- } else {
60+ } else if ( query ) {
6061 this . #partialUpdateLink( { queryString : `#${ query } ` } ) ;
62+ } else {
63+ this . #partialUpdateLink( { queryString : query } ) ;
6164 }
6265 }
6366
@@ -149,6 +152,7 @@ export class UmbLinkPickerModalElement extends UmbModalBaseElement<UmbLinkPicker
149152 color = "positive"
150153 look = "primary"
151154 label = ${ this . localize . term ( 'general_submit' ) }
155+ ?dis abled= ${ ! this . value . link . url && ! this . value . link . queryString }
152156 @click = ${ this . _submitModal } > </ uui- butto n>
153157 </ div>
154158 </ umb- body- layout>
@@ -169,7 +173,8 @@ export class UmbLinkPickerModalElement extends UmbModalBaseElement<UmbLinkPicker
169173 label= ${ this . localize . term ( 'general_url' ) }
170174 .value = ${ this . value . link . url ?? '' }
171175 ?dis abled= ${ this . value . link . unique ? true : false }
172- @change = ${ this . #onLinkUrlInput} >
176+ @change = ${ this . #onLinkUrlInput}
177+ ${ umbFocus ( ) } >
173178 </ uui- input>
174179 </ umb- property- layout>
175180 ${ when (
0 commit comments