Github user samk1 commented on the issue:
https://github.com/apache/couchdb-fauxton/pull/741
Hello all.
Thanks very much for the advice and positive feedback.
I have changed the dropdown to use react-bootstrap which seems to be a lot
cleaner.
I am still having some issues though:
- the dropdown is closing at unwanted times - when you click on the filter
and when you try and type anything. I have set the input to autofocus when the
dropdown opens so clicks closing the dropdown is mitigated a little bit, but
would still like to clear this up properly. closing the dropdown as soon as you
type anything is obviously a bit of a show stopper.
- still not sure how to properly implement the max-height on the
attachments dropdown. I have removed the hacks that were there before.
- there seems to be something wrong with the URL in the links. have not
investigated this properly yet.
Anyway, I have mainly put this commit in to check with @garrensmith if I
have the data flow correct now. It does simplify the code a lot to do it this
way.
I have seen some answers on stackoverflow that show how to prevent a
dropdown with an input in it from closing
[here](http://stackoverflow.com/questions/32510976/react-bootstrap-dropdown-with-input-wont-stay-open).
I don't feel that any of these are the 'right' way though.
The dropdown filter example in the react-bootstrap docs is good but it
removes the ability to close the dropdown when clicking outside of the
dropdown, which I think we should still have.
The default react-bootstrap Dropdown implementation works by using
RootCloseOverlay (in react-overlays) on Dropdown.Menu which adds event
listeners to the document onclick and on onkeydown. for onkeydown, it closes
the dropdown whenever escape is pressed. In this case the dropdown is closed
when any key is pressed. The onclick event is ignored if it comes from inside
the dropdown menu - so if you click inside the dropdown, the dropdown shouldn't
close. You can see this if you click on the filter icon.
I think it is something to do with the input. I will keep on trying to find
the root of this problem but would appreciated any help/suggestions in the
meantime. I have not yet tried just removing the input to see if keypresses
still close the dropdown.
@justin-mcdavid-ibm these are really good suggestions and I look forward to
implementing them once I fix the problem with the dropdown closing before you
can filter anything.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---