Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

95
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda