-
-
Notifications
You must be signed in to change notification settings - Fork 538
Closed
Description
Versions:
react-tooltip: 3.3.0
react: 15.4.2
Issue:
I have a tooltip that is rendering data from the state around it, to display an error message if a textfield is invalid.
render() {
return (
<input
type={'text'}
value={this.state.value}
onChange={this.onTextChange}
data-tip={this.state.errors[0]} // only show most significant error
data-for={this.props.name}
data-event={'focus'}
data-event-off={'focusout'}
/>
...
<ReactTooltip
id={this.props.name}
place={'bottom'}
effect={'solid'}
multiline={true}
/>
);
}
As far at the focus events go, it works perfectly. However, when I revalidate the field and call
this.setState({
errors: newArrayOfErrors,
});
the the tooltip does not updated.
I have tried
this.setState({
errors: newArrayOfErrors,
}, () => ReactTooltip.rebuild());
and
componentDidUpdate() {
ReactTooltip.rebuild());
}
but there is no difference in behavior.
Is there a way to include stateful data in the tooltip?
khorolets, ilya-pyatin, seethroughdev, vuau, bbeckrest and 19 more
Metadata
Metadata
Assignees
Labels
No labels