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

100
Visualizações
NG-Zorro set specific width for options inside the dropdown causes to also set same width to other dropdowns

I have been using ng-zorro for my angular project, I am using this component: https://ng.ant.design/components/select/en#ng-content

However, I need to set specific with for the options the dropdown displays after it opens, I tried to do this:

>    :host ::ng-deep {   .ant-select-dropdown {
>       width: 112px !important;   } }

However, this style also applyes to all the other dropdowns, and I only wanted to give this width to just on dropdown, not all.

I have been looking for other alternative instead of ::ng-deep , but couldn't find one.

I really need to apply with to just one dropdown and not all of them, How can I accomplish this without the issue on ::ng-deep ?

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

0

::ng-deep change the style in every component (as you can see) and is deprecated actually (https://angular.io/guide/component-styles#deprecated-deep--and-ng-deep)

You could use ViewEncapsulation.None (documentation : https://angular.io/guide/view-encapsulation)

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