-
Notifications
You must be signed in to change notification settings - Fork 113
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
hlmSelect does not have an invalid state style #289
Comments
@thatsamsonkid is this related to your most recent tests? |
@goetzrobin if i understood correctly it just the appearance of the error state for select using ng-model is not working as expected. So label is not turning red essentially. So separate issue from the other one im pretty sure. |
I will add I don't think we have support for wrapping the select in a label because label won't have access to ngControl in this case. Unless anyone has any ideas on that one. I can only think to have brnLabel check for instances of select as a contentchild in this case |
@benjaminforras does this example help: spartan/libs/ui/select/select.stories.ts Line 133 in 5952cd4
I see your label seems to be missing the hlmLabel directive and you are using the brn-select instead of the helm-select component. We should probably double check the docs and add examples for template driven and reactive forms |
@benjaminforras Ah I see unfortunately Shadcn styling doesnt actually turn the select (destructive red) by default if you want to be that way then you would need to modify to that but seems they only give label and error message the red styling for denoting an error. See the example here under select form https://ui.shadcn.com/docs/components/select |
I think adding the styling is a nice touch and I'd like to support it. I'll take a look at it |
@goetzrobin This reminds me we need to an create an error directive also so we can easily show hide the error as well similar to mat-error and keep the styling and spacing consistent when attached to a form field |
Please provide the environment you discovered this bug in.
Copy pasted from the components page and added ngModel with a validator.
Which area/package is the issue in?
select
Description
While Angular adds the necessary ng-invalid ng-touched classes to the host (brn-select), the helm does not provide any styling for the invalid state. Also, if wrapped in hlmLabel the label also doesn't change (based on the classes it only checks for hlmInput state).
Please provide the exception or error you saw
No response
Other information
No response
I would be willing to submit a PR to fix this issue
The text was updated successfully, but these errors were encountered: