Topic: Not able to set focus on a form field on a modal

triklimops-org priority asked 2 years ago

Expected behavior Open a modal and choose a field I want to set focus, the input field would have the focus.

Actual behavior The input field does not have the focus even though I set it in the code on display of the modal

Resources (screenshots, code snippets etc.)

const modalElement = document.getElementById('my-modal') const myModal= new mdb.Modal(modalElement )

Mikołaj Smoleński staff commented 2 years ago

Do you have any errors in the console? Are you sure the code is correct and dedicated for you version of UI KIT (MDB4 4.20.0 jQuery)? Can you recreate the issue in our snippets generator?

Keep coding!

Please insert min. 20 characters.


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



Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB jQuery
  • MDB Version: MDB4 4.20.0
  • Device: Computer
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: No