You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
Create an Angular component to make a reusable input text.
Add @Input() type: string = 'text'; inside the component.
Import and use the input component inside the page component.
Add the type attribute with a valid value like email, like this type="email".
Run the development server and view in the browser
Screenshots
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:
The text was updated successfully, but these errors were encountered:
Describe the bug
When trying to make a reusable
input
component in Angular and wanting to pass atype
property with@Input
, the preset styles for the<input>
tags are applied because of the CSS selectorsTo Reproduce
Steps to reproduce the behavior:
@Input() type: string = 'text';
inside the component.input
component inside the page component.type="email"
.Screenshots
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 calledtype
created by the developer.This is how it should look without those unwanted styles:
The text was updated successfully, but these errors were encountered: