Skip to content

Commit ed2a99e

Browse files
committed
Fix for #143, eliminate the float effect when using solid
1 parent 76ef6b1 commit ed2a99e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/index.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class ReactTooltip extends Component {
4444
constructor (props) {
4545
super(props)
4646
this.state = {
47-
place: 'top', // Direction of tooltip
47+
place: '', // Direction of tooltip
4848
type: 'dark', // Color theme of tooltip
4949
effect: 'float', // float or fixed
5050
show: false,
@@ -199,8 +199,8 @@ class ReactTooltip extends Component {
199199
}
200200
const placeholder = getTipContent(originTooltip, content, isMultiline)
201201

202-
// If e is instance of FocusEvent, switch to `solid` effect
203-
const isFocus = e instanceof FocusEvent
202+
// If it is focus event, switch to `solid` effect
203+
const isFocus = e instanceof window.FocusEvent
204204

205205
this.setState({
206206
placeholder,
@@ -264,7 +264,8 @@ class ReactTooltip extends Component {
264264
this.clearTimer()
265265
this.delayHideLoop = setTimeout(() => {
266266
this.setState({
267-
show: false
267+
show: false,
268+
place: ''
268269
})
269270
this.removeScrollListener()
270271
}, parseInt(delayHide, 10))

0 commit comments

Comments
 (0)