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
Setting the size property on does not change the input size. Upon setting size="small" I would expect that the p-inputtext-sm class is added to the input element, which is doesn't.
This stripping out of entered inputStyleClass and styleClass has happened since v18 and continues in v19 on multiple components where the size property has been introduced:
p-datatable-sm ignored in styleClass on p-table
p-inputtext-sm ignored in inputStyleClass on p-autoComplete
Pull Request Link
No response
Reason for not contributing a PR
Lack of time
Unsure how to implement the fix/feature
Difficulty understanding the codebase
Other
Other Reason
Happy to help and provide a PR with some guidance.
Run the application and notice the input size is normal, and no p-inputtext-sm class name has been added to the input
Add size="large" as per the documentation, again the input size is normal. No p-inputtext-lg class has been added to the input
Secondly when adding p-inputtext-sm as to inputStyleClass within p-datepicker it is ignored meaning a workaround can not take place.
5. add the following as an attribute of p-datepicker inputStyleClass="p-inputtext-sm"
6. Run the application and inspect the input
7. The class p-inputtext-sm should be added to the input but has been ignored.
NB: any other value added as inputStyleClass does get added, but p-inputtext-sm is ignored presumably because of the size attribute additions with v18.
I don't believe we should be stripping out values from either inputStyleClass and styleClass from any components. We should respect all inputStyleClass and styleClass entered by the user.
Expected behavior
Add size="small" to p-datepicker results in the addition of p-inputtext-sm class name to the input element
Add size="large" to p-datepicker results in the addition of p-inputtext-lg class name to the input element
Add inputStyleClass="p-inputtext-sm" to p-datepicker results in the addition of p-inputtext-sm class name to the input element
Add inputStyleClass="p-inputtext-lg" to p-datepicker results in the addition of p-inputtext-lg class name to the input element
The text was updated successfully, but these errors were encountered:
ChrisRitchie
changed the title
Autocomplete - inputStyleClass does not get added to input class element
<p-datepicker> - size property is not respected
Jan 6, 2025
Describe the bug
Setting the size property on does not change the input size. Upon setting
size="small"
I would expect that thep-inputtext-sm
class is added to the input element, which is doesn't.Docs:
https://primeng.org/datepicker#sizes
p-inputtext-sm
can also not be added to the inputStyleClass either as a work around. This particular class is striped out when added to inputStyleClass.https://primeng.org/datepicker#api.datepicker.props.inputStyleClass
This stripping out of entered inputStyleClass and styleClass has happened since v18 and continues in v19 on multiple components where the
size
property has been introduced:p-datatable-sm
ignored in styleClass on p-tablep-inputtext-sm
ignored in inputStyleClass on p-autoCompletePull Request Link
No response
Reason for not contributing a PR
Other Reason
Happy to help and provide a PR with some guidance.
Reproducer
https://stackblitz.com/edit/github-ktsfpzqr
Environment
Mac Silicon (M1)
Node 18.20.3
Angular: 19.0.2
PrimeNG: 19.0.2
Angular version
19.0.2
PrimeNG version
v19
Node version
18.20.3
Browser(s)
Firefox 133.0.3 (aarch64)
Steps to reproduce the behavior
p-inputtext-sm
class name has been added to the inputp-inputtext-lg
class has been added to the inputSecondly when adding
p-inputtext-sm
as to inputStyleClass within p-datepicker it is ignored meaning a workaround can not take place.5. add the following as an attribute of p-datepicker
inputStyleClass="p-inputtext-sm"
6. Run the application and inspect the input
7. The class
p-inputtext-sm
should be added to the input but has been ignored.NB: any other value added as inputStyleClass does get added, but
p-inputtext-sm
is ignored presumably because of the size attribute additions with v18.I don't believe we should be stripping out values from either inputStyleClass and styleClass from any components. We should respect all inputStyleClass and styleClass entered by the user.
Expected behavior
size="small"
to p-datepicker results in the addition ofp-inputtext-sm
class name to the input elementsize="large"
to p-datepicker results in the addition ofp-inputtext-lg
class name to the input elementinputStyleClass="p-inputtext-sm"
to p-datepicker results in the addition ofp-inputtext-sm
class name to the input elementinputStyleClass="p-inputtext-lg"
to p-datepicker results in the addition ofp-inputtext-lg
class name to the input elementThe text was updated successfully, but these errors were encountered: