From f081a74257337310054128abfc3bc00e000a358c Mon Sep 17 00:00:00 2001 From: Vladimir Konnov Date: Wed, 20 Dec 2017 15:56:03 +0400 Subject: [PATCH] New default behavior onMouseOut: now removing highlighting from last selected item on mouse out. Default behavior isn't applied when selectOnBlur prop is true/on in order to have selectOnBlur functionality to work properly --- lib/Autocomplete.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Autocomplete.js b/lib/Autocomplete.js index 202389d8..23b1eebf 100644 --- a/lib/Autocomplete.js +++ b/lib/Autocomplete.js @@ -433,6 +433,7 @@ class Autocomplete extends React.Component { ) return React.cloneElement(element, { onMouseEnter: () => this.highlightItemFromMouse(index), + onMouseOut: () => { if (!this.props.selectOnBlur) this.highlightItemFromMouse(null) }, onClick: () => this.selectItemFromMouse(item), ref: e => this.refs[`item-${index}`] = e, })