As per #1 discussion the component will call its `onChange` callback
every time the user selects a new value (including during navigation).
The following changes were made:
- stateless/DropDownList: onSelect was replaced by onNavigate that fires
while the user searches or navigates through the items with the keyboard
- DropDownList: remove index property. High order component
should operate with the `value`
- DropDownList: remove previous/selected flags as they are no
longer needed
- DropDownList: onSelect was replaced by onNavigate. OnNavigate calls
the onChange callback every time. OnChange does the same but also closes
the list
- DropDownList: onChange callback is called every time the value
changes, event during navigation
- onClose and onOpen callbacks of the stateless component are merged into
one onToggle that receives true/false argument which indicates popup
visibility state.
- stateless component call onChange when it is blurred. The parent
component which holds the state closes it through the props.
- when popup is opened the stateless component adds mousedown event listener to
the documentElement in order to detect clicks outside of the component
area. If such click is detected the widget fires its change event, the
parent stateful component closes it.
- the aforementioned event listener is removed when the popup closes or
when the component is about to unmount