In my view I have the following:
<input placeholder="Enter a subject here" data-bind="hasFocus: showDropdown, valueUpdate: 'afterkeydown' />
<div class="dropdown" data-bind="visible: showDropdown">
The idea is that when the input has focus, a dropdown is shown, and the user can type to filter the items shown in that dropdown.
What's happening is that when I click an item in the dropdown, the input loses focus, and the dropdown closes before the click event is handled, so any anchors in the dropdown never work.
I could tie up some kind of computed observable that hides the dropdown when the input loses focus AND the clicked element is not the dropdown, but I wanted to see if there was a more elegant approach that knockout offers - maybe by adding some kind of delay before the lose-input-focus event is triggered? What are my options?