select label not rendered correctly


Topic: select label not rendered correctly

elmajed2007 asked 10 months ago

Expect to display label correctly as shown on your side

*label crossed by outline *

Resources (screenshots, code snippets etc.)enter image description here


Marcin Luczak staff commented 10 months ago

Hello,

Could you please provide your code, a snippet of it, or the best create a working project of it on the MDB GO, as this is the jQuery support section and your select seems to be from the MDB Standard and there might be some versioning incompatibilities.

Keep coding, Marcin


jmarkham pro premium priority answered 10 months ago

I am having the same issues with selectboxes, but only when they are populated at runtime by javascript. The line fixes itself away if you click the selectbox, seems like a state issue.


Marcin Luczak staff answered 10 months ago

For the dynamically populated component you have to init it manually. For the MDB5 Select generated inside the modal (as shown in the previous post) you can try this code:

myModal.addEventListener('shown.mdb.modal', () => {
    const selectEl = document.getElementById('mySelect')
    Select.getInstance(selectEl).dispose()   // only if select was generated before the shown
    new mdb.Select(selectEl)   // reinitializing the select component
}

Hope this will help.

Keep coding, Marcin


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
  • User: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: MDB4 4.19.2
  • Device: computer
  • Browser: crome
  • OS: windows 10
  • Provided sample code: No
  • Provided link: No