Skip to content

Commit

Permalink
feat(content): delay mouse on bowl
Browse files Browse the repository at this point in the history
  • Loading branch information
crimx committed Apr 27, 2018
1 parent ae95938 commit 0aa1b90
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/content/components/SaladBowl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,17 @@ export type SaladBowlProps = {
export default class SaladBowl extends React.PureComponent<SaladBowlProps> {
readonly bowlRef = React.createRef<HTMLDivElement>()
initStyle = { x: 0, y: 0, scale: 0 }
mouseOnBowlTimeout: any

handleMouseEnter = () => {
this.props.mouseOnBowl(true)
this.props.searchText()
this.mouseOnBowlTimeout = setTimeout(() => {
this.props.mouseOnBowl(true)
this.props.searchText()
}, 800)
}

handleMouseLeave = () => {
clearTimeout(this.mouseOnBowlTimeout)
this.props.mouseOnBowl(false)
}

Expand Down

0 comments on commit 0aa1b90

Please sign in to comment.