Skip to content

Commit

Permalink
fix(artifacts): Fix SpEL text input used in React components (#6712)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkschneider authored Mar 18, 2019
1 parent b4ca2b8 commit 2ac15b2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions app/scripts/modules/core/src/widgets/spelText/SpelText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@ export class SpelText extends React.Component<ISpelTextProps, ISpelTextState> {
this.renderSuggestions();
}

public componentDidUpdate() {
this.renderSuggestions();
public componentDidUpdate(_: Readonly<ISpelTextProps>, prevState: Readonly<ISpelTextState>): void {
if (prevState.textcompleteConfig !== this.state.textcompleteConfig) {
this.renderSuggestions();
}
}

private renderSuggestions() {
const input = $(this.spelInputRef.current);
if (!input.attr('contenteditable')) {
input.attr('contenteditable', 'true');
input.textcomplete(this.state.textcompleteConfig, {
maxCount: 1000,
zIndex: 9000,
dropdownClassName: 'dropdown-menu textcomplete-dropdown spel-dropdown',
});
}
input.attr('contenteditable', 'true');
input.textcomplete(this.state.textcompleteConfig, {
maxCount: 1000,
zIndex: 9000,
dropdownClassName: 'dropdown-menu textcomplete-dropdown spel-dropdown',
});
}

public render() {
Expand Down

0 comments on commit 2ac15b2

Please sign in to comment.