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

FormControl using incorrect variant? #269

Open
lighth7015 opened this issue Nov 8, 2023 · 1 comment
Open

FormControl using incorrect variant? #269

lighth7015 opened this issue Nov 8, 2023 · 1 comment

Comments

@lighth7015
Copy link

lighth7015 commented Nov 8, 2023

Good morning!

I'm working on a phone number validation TextField, however I've noticed that the TextField component doesn't work with @solid-primitives/input-mask, forcing me to roll my own using the FormGroup, Input and InputLabel controls to achieve the desired behavior; however, in doing this- I lose the ability to pass the variant prop through my control to the FormGroup, as the FormGroup seems to only use the default variant, which is weird.

I have a copy of my control hosted here, for reference.

Any assistance in fixing this would be greatly appreciated!

Thank you in advance!

@nate-summercook
Copy link

Hey @lighth7015
I'm no contributor here, but I noticed that you say you're using "Input" in your "FormControl". Please note that "Input" IS the standard variant of the input field.
This is in "TextField.jsx":

const variantComponent = {
    standard: Input,
    filled: FilledInput,
    outlined: OutlinedInput,
};

So if you'd like a different variant than the standard, you should also use that specific component as shown in that map from the TextField component.

Good luck! :)

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

No branches or pull requests

2 participants