File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
app/components/widgets/forms Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { socialMediaExtraPrefixes } from 'open-event-frontend/utils/dictionary/s
66interface Args {
77 prefix : string | undefined ,
88 value : string | undefined ,
9- onChange : ( text : string ) => void
9+ onChange : ( text : string | null ) => void
1010}
1111
1212export default class LinkField extends Component < Args > {
@@ -35,7 +35,8 @@ export default class LinkField extends Component<Args> {
3535 /**
3636 * Final value with prefix to be sent to parent component
3737 */
38- get finalValue ( ) : string {
38+ get finalValue ( ) : string | null {
39+ if ( ! this . fixedValue && this . prefix === 'https://' ) { return null ; }
3940 return this . prefix + this . fixedValue ;
4041 }
4142
@@ -63,7 +64,8 @@ export default class LinkField extends Component<Args> {
6364 setValue ( event : { target : HTMLInputElement } ) : void {
6465 const text = event . target . value ;
6566 this . value = this . fixValue ( text ) ;
66- this . args . onChange ( this . finalValue ) ;
67+ const finalUrl = this . value ? this . finalValue : null ;
68+ this . args . onChange ( finalUrl ) ;
6769 }
6870
6971 @action
You can’t perform that action at this time.
0 commit comments