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

Style error in Angular reusable input text components #964

Open
ZUR1C4T0 opened this issue Sep 16, 2024 · 0 comments
Open

Style error in Angular reusable input text components #964

ZUR1C4T0 opened this issue Sep 16, 2024 · 0 comments

Comments

@ZUR1C4T0
Copy link

Describe the bug
When trying to make a reusable input component in Angular and wanting to pass a type property with @Input, the preset styles for the <input> tags are applied because of the CSS selectors

To Reproduce
Steps to reproduce the behavior:

  1. Create an Angular component to make a reusable input text.
  2. Add @Input() type: string = 'text'; inside the component.
  3. Import and use the input component inside the page component.
  4. Add the type attribute with a valid value like email, like this type="email".
  5. Run the development server and view in the browser

Screenshots
image
image
image

Expected behavior
If CSS selectors were more specific, for example input[type=email] instead of [type=email], then the styles would only apply to tags and not to components with a custom attribute called type created by the developer.

This is how it should look without those unwanted styles:
image
image

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

1 participant