Skip to content

Commit

Permalink
TASK: Trim search term on manuall apply for
Browse files Browse the repository at this point in the history
  • Loading branch information
markusguenther committed Oct 8, 2024
1 parent 41fb986 commit 500f950
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/neos-ui-editors/src/Library/LinkInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,16 @@ export default class LinkInput extends PureComponent {
}

handleManualSetLink = () => {
this.props.onLinkChange(this.state.searchTerm);
let {searchTerm} = this.state;
// trim tailing whitespace as it can cause issues
if (typeof searchTerm === 'string') {
searchTerm = searchTerm.trim();
this.setState({searchTerm});
}

this.props.onLinkChange(searchTerm);
this.setState({
isEditMode: !this.state.searchTerm
isEditMode: !searchTerm
});
}

Expand Down

0 comments on commit 500f950

Please sign in to comment.