lib: Improve click handling of react select component
lib: Improve click handling of react select component

Using mouseDown isn't very reliable - lots of input methods generate
clicks instead of mousedown events, even our testing.
Since blur events fire before click does, we need to detect clicks
elsewhere in the document to close the dropdown.

Closes #4759
Reviewed-by: Stef Walter <8a7fbf0f15d3ad982af54ef28f5c117d2494b76c@redhat.com>

michalskrivanek/cockpit,vanloswang/cockpit,larskarlitski/cockpit,petervo/cockpit,garrett/cockpit,moraleslazaro/cockpit,cockpituous/cockpit,larsu/cockpit,deryni/cockpit,xhad/cockpit,arilivigni/cockpit,Scribery/cockpit,cockpit-project/cockpit,deryni/cockpit,martinpitt/cockpit,dperpeet/cockpit,andreasn/cockpit,moraleslazaro/cockpit,deryni/cockpit,xhad/cockpit,larskarlitski/cockpit,vanloswang/cockpit,dperpeet/cockpit,martinpitt/cockpit,petervo/cockpit,stefwalter/cockpit,mareklibra/cockpit,larsu/cockpit,arilivigni/cockpit,sgallagher/cockpit,dperpeet/cockpit,arilivigni/cockpit,moraleslazaro/cockpit,cockpit-project/cockpit,arilivigni/cockpit,garrett/cockpit,harishanand95/cockpit,arilivigni/cockpit,SotolitoLabs/cockpit,andreasn/cockpit,petervo/cockpit,larsu/cockpit,cockpituous/cockpit,moraleslazaro/cockpit,sgallagher/cockpit,larsu/cockpit,mvollmer/cockpit,cockpituous/cockpit,Scribery/cockpit,larskarlitski/cockpit,vanloswang/cockpit,andreasn/cockpit,harishanand95/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,arilivigni/cockpit,garrett/cockpit,mvollmer/cockpit,mareklibra/cockpit,Scribery/cockpit,SotolitoLabs/cockpit,mareklibra/cockpit,sgallagher/cockpit,moraleslazaro/cockpit,mvollmer/cockpit,garrett/cockpit,larskarlitski/cockpit,martinpitt/cockpit,dperpeet/cockpit,vanloswang/cockpit,larskarlitski/cockpit,SotolitoLabs/cockpit,petervo/cockpit,cockpit-project/cockpit,moraleslazaro/cockpit,Scribery/cockpit,SotolitoLabs/cockpit,garrett/cockpit,michalskrivanek/cockpit,mareklibra/cockpit,deryni/cockpit,andreasn/cockpit,harishanand95/cockpit,xhad/cockpit,sgallagher/cockpit,vanloswang/cockpit,mareklibra/cockpit,stefwalter/cockpit,michalskrivanek/cockpit,michalskrivanek/cockpit,xhad/cockpit,larskarlitski/cockpit,petervo/cockpit,xhad/cockpit,larskarlitski/cockpit,larsu/cockpit,andreasn/cockpit,andreasn/cockpit,andreasn/cockpit,stefwalter/cockpit,mvollmer/cockpit,cockpit-project/cockpit,vanloswang/cockpit,Scribery/cockpit,stefwalter/cockpit,SotolitoLabs/cockpit,SotolitoLabs/cockpit,sgallagher/cockpit,deryni/cockpit,sgallagher/cockpit,martinpitt/cockpit,petervo/cockpit,dperpeet/cockpit,harishanand95/cockpit,michalskrivanek/cockpit,harishanand95/cockpit,sgallagher/cockpit,mvollmer/cockpit,vanloswang/cockpit,mareklibra/cockpit,mareklibra/cockpit,stefwalter/cockpit,cockpituous/cockpit,Scribery/cockpit,martinpitt/cockpit,stefwalter/cockpit,xhad/cockpit,deryni/cockpit,cockpituous/cockpit,michalskrivanek/cockpit,SotolitoLabs/cockpit,Scribery/cockpit,michalskrivanek/cockpit,harishanand95/cockpit,cockpituous/cockpit,xhad/cockpit,dperpeet/cockpit,larsu/cockpit,arilivigni/cockpit,dperpeet/cockpit,stefwalter/cockpit,harishanand95/cockpit,deryni/cockpit,petervo/cockpit