Topic: MDBDropdown is closing unexpectedly

Carlos M. Casas Cuadrado free asked 3 years ago


I just migrated from mdbreact4 to mdbreact5 and the dropdowns don't behave as expected. I searched in the docs and the forum and I couldn't find an answer. Could you please help?

*Expected behavior*I have a navbar with a dropdown. The dropdown has a small form, so it should stay as long as the user doesn't click away from the dropdown or the submit button. In particular, it should stay visible when I click any of the input components in the form. This used to work in mdbreact v4.

*Actual behavior*In mdbreact 5, as soon as I click on the input components, the dropdown closes...so I can't add anything to the input component. Going to the input component using TAB works, but I don't want users to do that.

Resources (screenshots, code snippets etc.)

<MDBNavItem>
  <MDBDropdown>
    <MDBDropdownToggle caret nav>Show form</MDBDropdownToggle>
    <MDBDropdownMenu right>
      <form>
        [...]
      </form>
    </MDBDropdownMenu>
  </MDBDropdown>
</MDBNavItem>

I saw another post saying that I should set autoClose to false, but I don't seem able to do that....

Thanks for the help!


Krzysztof Wilk staff answered 3 years ago


Hi!

I see the problem. Thanks for reporting this bug - we'll fix it as soon as possible :)

For now, I'm afraid that I don't see any solution. Maybe you could try to use button + form in the modal combination?

Best regards


Carlos M. Casas Cuadrado free commented 3 years ago

Hi! Thanks for the quick answer! Luckily for me, I'm just playing around learning the framework, so no need for a workaround :-)



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Resolved

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB React
  • MDB Version: 5.0.1
  • Device: Lenovo
  • Browser: Firefox
  • OS: W10
  • Provided sample code: No
  • Provided link: No