webcat12345 / ngx-intl-tel-input

Phone number input field to support international numbers, Angular
MIT License
213 stars 339 forks source link

Impossible to set width of form control #380

Closed iFederx closed 3 years ago

iFederx commented 3 years ago

Hi, is there a way to set the width of the form control? I tried passing a class to cssClass with width: 100%, but it doesn't work. Any suggestion? :) Thanks

iFederx commented 3 years ago

Solved

Scantraxx123 commented 3 years ago

I figured it out. The solution is not optimal but okay. You have to look into node_modules\intl-tel-input\build\css\intlTelInput.css file and add your new css file in your project this:

:host ::ng-deep .iti {
  position: relative;
  display: inline-block;
  width: 100%;
}
jorool commented 2 years ago

Solved

How did you solve it?

guybedo commented 1 year ago

Easier to just add an id to the component:

<ngx-intl-tel-input id="mobileNumber">

and then add in your css something like:


#mobileNumber .iti {
    width: 100%;
}