I am trying to display a FormControl
on a form to hold a telephone country code prefix, and I want it to always display a plus sign in the left-padding area. My bet was to use a :before
element on the input, but surprisingly I cannot get it to appear in the DevTools inspector. When I started to notice the problem I even went despearate and tried to place the :before
element on all inputs - to no avail. On the other hand, styles for the main input element work as expected.
Same goes with :after
.
So my question is - does placing a :before
or :after
element work for anyone? Is it a know "feature" of ReactiveForms or a bug?
css
input[name="telCountryCode"]:before {
content: '+';
display: inline-block;
position: absolute;
top: 0;
left: 0;
width: 1rem;
height: 1rem;
}
ts
this.form = this.fb.group({
telCountryCode: '',
telNumber: '',
});