I have a problem with ion-select component which is the width of it's popover items. it doesn't match the size of it's parent ion-select.
I tried to fix this issue by using onclick event as below:
[(ngModel)]="value" [id]="id" class="ps-select" [okText]="okText" [cancelText]="cancelText" [multiple]="false" [interface]="popover" [placeholder]="placeHolderTrans"> {{ item.description }}
ts file:
onClick(event){ this.divwidth = event.srcElement.clientWidth; this.cssclass = document.querySelector('.popover-content') as HTMLElement; console.log("sudfasu",this.divwidth) ; this.cssclass.style.width = this.divwidth; }
but when I try to catch the div with class "popover-content" I always got an error of 'Cannot read property 'style' of null'
can anyone help me with this problem or if there's another way to set popover list items width ?