Premium support for our pure JavaScript UI components


Post by gorakh.nath »

Hi Team,
I am getting error after changing the view to any other time line like week or year.After getting this error my project is crashing and coming as blank.
I have attached sample application after reproduce the same issue.I also attached screen shot for reference.
Step to reproduce this issue:-

  1. Change the date view from day to week or year.
  2. App will crash same error you can see in console.
    After crash again we have to reload the page to see our data.
Attachments
AppCrashOnDateChange.zip
(2.99 MiB) Downloaded 50 times
Screenshot 2021-10-28 at 12.26.44 AM.png
Screenshot 2021-10-28 at 12.26.44 AM.png (564.89 KiB) Viewed 332 times

Post by saki »

This does not seem to be a problem in Scheduler because I traced it down to line:

setTimelineView(value);

in viewPresetHandler. The line changes state which probably results in the component re-render which destroys the combo while still in the handler.

Also, if you need to change a Scheduler property you can bind it which is much safer. For example the following (pseudo-)code changes the viewPreset:

const [preset, setPreset] = useState('weekAndDay');

const handler = ({newPreset}) => {
    setPreset(newPreset);
}

return <BryntumSchedulerPro {...schedulerConfig} viewPreset={preset} />

Post by gorakh.nath »

Hi Saki,
I tried the code that you suggested above and then page crashing was solved but another issue came and that is :-
If I navigate to other pages that is available in my website then again page is crashing.I think in unmount of scheduler some thing is failing.
Steps:-

  1. Change the date from day to week
  2. Navigate to other page
    It will throw error, the sample that I have attached have not other pages but if require I will try to add routing for nowI have attached the screenshot for reference. Please suggest me what should I change.
Attachments
Screenshot 2021-10-28 at 6.10.32 AM.png
Screenshot 2021-10-28 at 6.10.32 AM.png (645.53 KiB) Viewed 319 times

Post by Maxim Gorkovsky »

Could you please provide updated test case? So we know what you're doing exactly.


Post Reply