When I open event, scheduler change currentView. it is a bug?

Hello,

I have a problem with my scheduler.

I created a stackblitz with same problem.

So, I have my scheduler with currentView 'Day', if I click inside an event, it opens custom modal, the currentView of scheduler change to default view(Month). How can I manage this problem? When I click inside event, scheduler don't need to change to default currentView. But if I open an event when I currentView is Day I don't want change currentView. This is a bug?

This problem is when I have enabled tooltip, if I disable tooltip it works without problem.

I hope you understand the problem.


Let me know if you some suggestions :)


Here a stackblitz with problem: https://stackblitz.com/edit/react-lv3wkn?file=index.js


1 Reply

SR Swathi Ravi Syncfusion Team October 2, 2023 10:48 AM UTC

Hi Alberto,


We have reviewed the issue you reported by examining the sample you provided. We would like to inform you that in your shared sample, you are directly specifying the current view value as "month." Therefore, when you update the state variable in the eventClick, the component will re-render, and at that time, the current view will be set to "month," causing it to navigate to the month view in eventClick. To resolve this issue, you need to update the currentView property by using state variable as shown in the snippet below.


Sample: https://stackblitz.com/edit/react-lv3wkn-9pmbal?file=index.js


[index.js]

 const [currentViewsetCurrentView] = useState("Month"); 

<ScheduleComponent

            ref={scheduleObj}

            currentView={currentView}

            eventClick={(e=> {

              setDataRow(e.event);

              setComponentOpen(!componentOpen);

              setCurrentView(scheduleObj.current.currentView);

            }}

          >

          </ScheduleComponent>



Regards,

Swathi Ravi


Loader.
Up arrow icon