英文:
Disable the KendoReact Calendar Fast Navigation Bar globally
问题
KendoReact Calendar Fast Navigation Bar目前在支持React 18的所有KendoReact版本中存在问题,详见此GitHub问题。
我们正在通过禁用Calendar Fast Navigation Bar来解决此问题。这对于简单的孤立组件(如DatePickers)是一个合适的解决方案,但不幸的是对于例如KendoReact Grid筛选菜单等问题无济于事。请参见此StackBlitz以查看问题的工作示例。
是否有一种全局禁用Calendar Fast Navigation Bar的方法,以便我们不必在每个地方应用这个并创建自定义Grid筛选器?
英文:
The KendoReact Calendar Fast Navigation Bar is currently broken in all versions of KendoReact that support React 18 as per this GitHub issue.
We are working around the issue by disabling the Calendar Fast Navigation Bar. This is a suitable workaround for simple isolated components such as DatePickers, but unfortunately does nothing to address the issue in for example KendoReact Grid filter menus. See this StackBlitz for a working example of the issue.
Is there a way to globally disable the Calendar Fast Navigation Bar so we don't have to apply this everywhere and create custom Grid filters?
答案1
得分: 0
这可以通过使用 CalendarPropsContext
来实现,具体描述请参考这里。
例如:
const calendarProps = React.useCallback(
(calendarProps: CalendarProps) => ({
...calendarProps,
navigation: false,
}),
[]
);
return (
<CalendarPropsContext.Provider value={calendarProps}>
...
</CalendarPropsContext.Provider>
);
英文:
This can be done using the CalendarPropsContext
as described here.
e.g.
const calendarProps = React.useCallback(
(calendarProps: CalendarProps) => ({
...calendarProps,
navigation: false,
}),
[]
);
return (
<CalendarPropsContext.Provider value={calendarProps}>
...
</CalendarPropsContext.Provider>
);
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论