MatPaginator pageSizeOptions immutable after init
23.5K reputation · 27 Dec 2022, 03:33 UTC
Goal
To dynamically update the pageSizeOptions of MatPaginator after the component has rendered, so that the drop‑down reflects new values supplied by the host component.
Context
The MatPaginator API exposes pageSizeOptions as an @Input that is only read during ngOnInit. In Angular Material 15 the internal array is copied once and never refreshed, meaning changes to the bound array are ignored.
Unresolved Decision
There is no event or lifecycle hook that notifies the paginator when the options list has changed, and the issue tracker contains open requests to make pageSizeOptions reactive. No official solution has been merged, leaving the behavior unchanged.
Questions
- Is there a supported way to trigger a re‑render of
pageSizeOptionsafter the paginator has been initialized? - Would a future Angular Material release introduce a change in the
MatPaginatorlifecycle to allow reactive updates? - What workarounds (e.g., recreating the paginator or using a custom wrapper) are recommended while awaiting official support?