The mat-form-field components can currently be styled app wide with MAT_FORM_FIELD_DEFAULT_OPTIONS.
On a per case basis, you can also override that default, using the appearance attribute.
mat-paginator also holds a mat-form-field, but it is currently not possible to alter that field's appearance.
For the same reason you might want to change a particular mat-form-field's appearance, you might want to alter the appearance of the mat-form-field contained inside a mat-paginator.
To be fair, it is also because mat-paginator with a default fill appearance looks pretty broken now, and being able to set it to standard would be a good workaround to this issue.
@jelbourn / @mmalerba when will the discussion happen on this. Is there a way to be part of that discussion ?
Im suggesting to make a InjectionToken MAT_PAGINATOR_DEFAULT_OPTIONS where
appearance and DEFAULT_PAGE_SIZE can be provided.
Does anyone have any workarounds for this, while we wait for a solution? (Other than the obvious "don't use MAT_FORM_FIELD_DEFAULT_OPTIONS")
@BobDankert You could try providing an alternative value for MAT_FORM_FIELD_DEFAULT_OPTIONS lower down in the injector tree (such as providing it in the component that holds the paginator).
Thanks - worked perfectly! I didn't realize I could set that on a per-component basis - I had always been setting it at the module level.
I would be willing to implement this if there is consensus on the approach.
Proposals:
MAT_PAGINATOR_DEFAULT_OPTIONS injection token with {formFieldAppearance: MatFormFieldAppearance} as type (as suggested by @andreElrico)formFieldAppearance as input on mat-paginatorThis issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@BobDankert You could try providing an alternative value for
MAT_FORM_FIELD_DEFAULT_OPTIONSlower down in the injector tree (such as providing it in the component that holds the paginator).