Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding custom class names to options in type select #3904

Open
AravinthRavichandiran opened this issue Apr 30, 2024 · 0 comments
Open

Adding custom class names to options in type select #3904

AravinthRavichandiran opened this issue Apr 30, 2024 · 0 comments
Labels

Comments

@AravinthRavichandiran
Copy link

Question

How to add a CSS class name to the options of type select in the formly v5 material form?

Description

  • Formly v5
  • Using angular material
  • Angular v7

I'm trying to add a classname to the options in the select drop down box. This classname is part of a security feature. When I add the classname through the className field of the fieldConfig, it applies it to the formly-field on a top level, which is fine. When the dropdown box is opened, the options are opened and in the html, it is opened in a separate container div(cdk-overlay-container in the image below) that is not part of the form. This means the security feature of the classname is not applied to the options. Ideally I'm looking for a way where the classname would be applied for the options too.

image

Can I achieve this using custom wrappers or create a custom type of select that can do this? Or is there a config field that I'm missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant