Skip to content
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/components/widgets/forms/link-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { socialMediaExtraPrefixes } from 'open-event-frontend/utils/dictionary/s
interface Args {
prefix: string | undefined,
value: string | undefined,
onChange: (text: string) => void
onChange: (text: string | null) => void
}

export default class LinkField extends Component<Args> {
Expand Down Expand Up @@ -63,7 +63,11 @@ export default class LinkField extends Component<Args> {
setValue(event: { target: HTMLInputElement }): void {
const text = event.target.value;
this.value = this.fixValue(text);
this.args.onChange(this.finalValue);
if (this.value) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this.value ? this.finalValue : this

Copy link
Contributor Author

@maze-runnar maze-runnar Nov 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is showing

Type 'this' is not assignable to type 'string'.
  Type 'LinkField' is not assignable to type 'string'.

this.args.onChange(this.finalValue);
} else {
this.args.onChange(null);
}
}

@action
Expand Down