Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Input fields broken design after clicking on other url then back in browser

agenda priority asked 2 years ago


Hey,

when i write something to the Basic example input field here - https://mdbootstrap.com/docs/standard/forms/input-fields/ and then in main manu click on some other page like Support or Services and then i click back button in my web browser i get corrupted layout/design on input field (see attached screenshot).

enter image description here


agenda priority answered 2 years ago


Thank you. Can you let us know when you will apply the fix in new update/release.


Mateusz Lazaru staff answered 2 years ago


It seems like DOMContentLoaded fires before inputs receive their values back in several browsers.

try to use this code as a workaround:

document.addEventListener('DOMContentLoaded', () => {
  setTimeout(() => {
    const inputs = document.querySelectorAll('input.form-control')
    inputs.forEach((input) => {
      if(input.value != '') {
        input.classList.add('active')
      }
    })
  }, 100);
})

Kamila Pieńkowska staff answered 2 years ago


Thank you for letting us know about this bug. We will fix this as soon as possible.



Please insert min. 20 characters.

FREE CONSULTATION

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

Status

Answered

Specification of the issue

  • ForumUser: Priority
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: PC
  • Browser: Edge
  • OS: Windows 10 and 11
  • Provided sample code: No
  • Provided link: Yes