Autofocus material input doesn't work


Topic: Autofocus material input doesn't work

Custer pro premium asked a year ago

Expected behavior

If the autofocus on a input field is set, the label should automatically move up.

Actual behavior

The label doesn't move up. You have to klick in the input field again, that the label moves up.

Resources (screenshots, code snippets etc.)

enter image description here


Mateusz Łubianka staff answered a year ago

Hi @Custer,

You're right. There is a little issue with autofocus. I will add a task with this problem to our 'to do' list and we will fix this as soon as possible. For now you can add focus to input by jQuery:

$(document).ready(function() {
    $('#inputLGEx').focus();
})

Thank you very much.

Best,


Custer pro premium commented a year ago

Perfect, thank you :)


Mateusz Łubianka staff commented a year ago

I'm glad it works well :)


Custer pro premium commented 11 months ago

Solved in new version. Thanks.


Status

Closed

Specification of the issue
  • User: Pro
  • Premium support: Yes
  • Technology: jQuery
  • MDB Version: 4.13.0
  • Device: Computer
  • Browser: Chrome (newest)
  • OS: Windows 10 (1903)
  • Provided sample code: No
  • Provided link: No