Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

296
Visualizações
Materialize CSS - multiple select with disabled selected issue

Even on official MaterializeCSS page for Select when you select a value for multiple select you see the disabled selected "Choose your Option" and then the selected option(s).

enter image description here

It seems to me more user friendly to shoe only Option 1 as "Choose your option" is not a valid option.

I use the

      <option value="" disabled selected>Choose your option</option>

so once page is rendered the user got a hint what is required of them.

Working jsFiddle.

It seems to me that using jQuery solves this issue (see an example) but I am using pure javascript only.

So the question is How to not display disabled, selected text for multiple MaterializeCSS select.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Copied from your js fiddle , this will fix your unselect issue.

function  onSelectChange(s){
  const elOptions = s.querySelectorAll('option')
  elOptions[0].removeAttribute('selected') // this won't work
  elOptions[0].selected  = false; ///this will - tested //first option will be unselected
}
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda