From 0ba8f507d6eff34fea65fcd78fb8dbe859d59aad Mon Sep 17 00:00:00 2001
From: Hermann <blumh@ethz.ch>
Date: Mon, 14 May 2018 17:57:25 +0200
Subject: [PATCH] update documentation on list hide timeout

---
 src/views/selectList.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/views/selectList.js b/src/views/selectList.js
index 3bc9d5f..c7ed8d5 100644
--- a/src/views/selectList.js
+++ b/src/views/selectList.js
@@ -143,6 +143,14 @@ export default class SelectList {
       ]) : m(SearchField, Object.assign({}, {
         style: { background: 'rgb(78, 242, 167)' },
         onChange: ({ value, focus }) => {
+          // onChange is called either if the value or focus fo the SearchField
+          // changes.
+          // At value change we want to update the search
+          // at focus changt we hie the list of results. As focus change also
+          // happens while clicking on an item in the list of results, the list
+          // is hidden after a short Timeout that has to be sufficiently long
+          // to register the onclick of the listitem. Can be a problem for different
+          // OS and browsers.
           if (focus) {
             this.showList = true;
           } else if (!focus) {
-- 
GitLab