I get the error "Cannot find a differ supporting object 'width: 100%' " when I try to use style with p-menu or p-dropdown .
I had this issue when working with the p-confirmDialog, so I looked at their source to see what was going on. PrimeNG passes the value from the [style] attribute as-is to the component's [ngStyle], which takes an object. So, the solution is:
<p-confirmDialog [style]="{'width': '100%'}">
...
</p-confirmDialog>
https://github.com/primefaces/primeng/commit/b774ab2a5811b223c49dcef55ba84bcbcfa09579
++ [ngStyle] also works
<p-button
label="button"
[style]="{float: 'left'}"
styleClass="ui-button-info" ></p-button>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With