-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dropdown forms disappears on click #26189
Comments
I think it should close only for outside click, not inside dropdown. |
bug reports / issues need a working reduced test case showing the problem. for what it's worth, out of the box bootstrap's form dropdowns don't close when clicking outside of links/form controls - see https://www.bootply.com/mhuf1l1jAV ... so might be a problem with whatever extra code you're running |
@patrickhlauke |
That's due to this line: https://github.com/twbs/bootstrap/blob/v4-dev/js/src/dropdown.js#L57 But @vosidiy can you explain to us why it's an issue ? Because you just have to add a form tag to make it works |
@Johann-S then how to create tabs or some clickable element inside the dropdown-menu (see screenshot example, there is no any form element) |
that's right seems to me a valid use case. Any concerns @patrickhlauke or @mdo ? |
indeed it would make sense to keep the dropdowns more generic and to swallow (as in, don't close the dropdown) any clicks inside the dropdown container itself regardless of content. authors WILL use dropdowns for any sort of arbitrary content beyond just forms, so i'd rather see us tackle this use case directly instead of expecting authors to have to hack it. |
I'd like to try tackling this issue. Has it been agreed upon that dropdowns will not auto-close on clicks made inside the container? |
I know this is an older issue, but the behavior is still present in BS4 and (if I'm looking at the correct place) planned for BS5 as well. I'd also like to suggest that dropdowns do not toggle closed when clicking inside of them (by default, at least). The dropdown js confirms the behavior that clicking inside of a I'd argue it is almost always going to be a better user experience for the item you click on to remain visible. Is there a major use case I'm missing or not understanding as to why dropdowns close when clicking inside of them currently? |
This was addressed with #33389. |
I made dropdown login form, When you click on content of the dropdown it will close
The text was updated successfully, but these errors were encountered: