affinipay / react-bootstrap-autosuggest

A modern combo-box built for React and Bootstrap
https://affinipay.github.io/react-bootstrap-autosuggest/
ISC License
56 stars 18 forks source link

showToggle=auto causes input field to lose focus #4

Open viridia opened 8 years ago

viridia commented 8 years ago

When I set showToggle to the default value of 'auto', as soon as the toggle button appears the input control loses focus and I can no longer type unless I click on the input field again. I notice, however, that this isn't happening in your demo pages so I'm not sure what's different about my setup; I'm not doing anything particularly exotic beyond what's in your examples.

trevorr commented 8 years ago

I'm guessing that React must be remounting the input element during reconciliation, possibly because showing the toggle is causing an input-group div to be inserted around the input element. You could test this hypothesis by setting bsSize to small or large, which will force the input group div to always be present (source). If this is indeed the case, I may need to have showToggle auto force the presence of the input group.