Summary
EventTimelinePremium exposes a public onPreferencesChange prop, but it is never fired — the Timeline has no internal mechanism to change preferences (no preferences menu / toggle, no setPreferences method on its store). It's a dead public prop and should be removed before the stable release, since removing it afterwards would be a breaking change.
(No preferences-editing UI is planned for the Timeline right now. If it's added later, the callback should be reintroduced with the correct signature — see note below.)
Details
The only runtime call site of onPreferencesChange in the whole repo is EventCalendarStore.ts (setPreferences), which the EventCalendar's PreferencesMenu drives:
// EventCalendarStore — works: fires the callback
public setPreferences = (partial, event) => {
const eventDetails = createChangeEventDetails('none', event);
onPreferencesChange?.(updated, eventDetails);
if (!eventDetails.isCanceled && preferencesProp === undefined) {
this.set('preferences', updated);
}
};
The Timeline store has no equivalent: it only reads preferences / defaultPreferences at init and syncs the controlled prop into state — there is no internal preferences change, so onPreferencesChange never runs.
Note: preferences / defaultPreferences themselves are useful and should stay — ampm is read in TimelineGridHeader to format the header times (12h/24h), and they support controlled usage.
Secondary issue (resolved by removal): the Timeline's onPreferencesChange also had an inconsistent signature — event: React.UIEvent | Event instead of the eventDetails: SchedulerChangeEventDetails used everywhere else (including the Timeline's own onPresetChange).
Suggested fix
Remove onPreferencesChange from the Timeline's public surface:
- the prop declaration in
EventTimelinePremiumStore.types.ts (EventTimelinePremiumParameters)
- the PropTypes entry in
EventTimelinePremium.tsx
- the extraction in
useExtractEventTimelinePremiumParameters.ts
If preferences editing is added to the Timeline in the future, reintroduce onPreferencesChange with the standard (preferences, eventDetails: SchedulerChangeEventDetails) => void signature and wire it through a setPreferences method (mirroring EventCalendarStore).
Context
@mui/x-scheduler-premium (master, pre-stable).
Summary
EventTimelinePremiumexposes a publiconPreferencesChangeprop, but it is never fired — the Timeline has no internal mechanism to change preferences (no preferences menu / toggle, nosetPreferencesmethod on its store). It's a dead public prop and should be removed before the stable release, since removing it afterwards would be a breaking change.(No preferences-editing UI is planned for the Timeline right now. If it's added later, the callback should be reintroduced with the correct signature — see note below.)
Details
The only runtime call site of
onPreferencesChangein the whole repo isEventCalendarStore.ts(setPreferences), which the EventCalendar's PreferencesMenu drives:The Timeline store has no equivalent: it only reads
preferences/defaultPreferencesat init and syncs the controlled prop into state — there is no internal preferences change, soonPreferencesChangenever runs.Note:
preferences/defaultPreferencesthemselves are useful and should stay —ampmis read inTimelineGridHeaderto format the header times (12h/24h), and they support controlled usage.Secondary issue (resolved by removal): the Timeline's
onPreferencesChangealso had an inconsistent signature —event: React.UIEvent | Eventinstead of theeventDetails: SchedulerChangeEventDetailsused everywhere else (including the Timeline's ownonPresetChange).Suggested fix
Remove
onPreferencesChangefrom the Timeline's public surface:EventTimelinePremiumStore.types.ts(EventTimelinePremiumParameters)EventTimelinePremium.tsxuseExtractEventTimelinePremiumParameters.tsIf preferences editing is added to the Timeline in the future, reintroduce
onPreferencesChangewith the standard(preferences, eventDetails: SchedulerChangeEventDetails) => voidsignature and wire it through asetPreferencesmethod (mirroringEventCalendarStore).Context
@mui/x-scheduler-premium(master, pre-stable).