Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eventClick on V5 is refreshing the calendar when doing SetState #5519

Closed
phpbits opened this issue Jun 20, 2020 · 8 comments
Closed

eventClick on V5 is refreshing the calendar when doing SetState #5519

phpbits opened this issue Jun 20, 2020 · 8 comments

Comments

@phpbits
Copy link

phpbits commented Jun 20, 2020

Bug Reports

I'm using React and trying to add custom event info popover on EventClick. The problem is the calendar is refreshing when setting state. Is there any way to prevent this from happening? Thanks!

@arshaw
Copy link
Member

arshaw commented Jun 22, 2020

Though it's hard to know for sure because you didn't post a reduced test case, I believe I came across this bug and fixed it for the official v5 release.

Could you please get the latest code and verify?

@phpbits
Copy link
Author

phpbits commented Jun 22, 2020

@arshaw I'm just setting custom state on eventClick and I'm still getting the refresh issue onClick.

eventClick={ ( info ) => {
	this.setState( {
		isPopoverOpen: true,
		currentEvent: info,
	} );
} }

Screen Capture on 2020-06-22 at 20-24-19

@phpbits
Copy link
Author

phpbits commented Jun 22, 2020

Forgot to mention that this isn't happening on version 4. Thanks!

@Mick89
Copy link

Mick89 commented Jun 22, 2020

I have a similar problem with inserting into a form (php).

<form method="post" action="?">
  <div id='calendar'></div>
</form>

A click on the buttons in headerToolbar (prevYear,prev,next,nextYear today) will send the form.
I don't have this problem with version 4.

Thanks!

@arshaw
Copy link
Member

arshaw commented Jun 22, 2020

@Mick89 and @phpbits , I think you are describing two different problems. I can't help either of you unless you post a runnable demo:

runnable demo instructions

Would really appreciate it because the time saved reproducing will be time spent fixing. I'm closing this issue until then.

@arshaw arshaw closed this as completed Jun 22, 2020
@Mick89
Copy link

Mick89 commented Jun 23, 2020

Excuse me.

A click on the buttons in headerToolbar (prevYear,prev,next,nextYear today OR month, week, day) will send the form (or refreshing the calendar).
I don't have this problem with version 4.

https://codepen.io/Mick89/pen/jOWmMMB

Thanks again!

@phpbits
Copy link
Author

phpbits commented Jun 23, 2020

@arshaw Managed to fixed my issue by using initialEvents instead of events when fetching data.

@Ben-CA
Copy link

Ben-CA commented Aug 24, 2022

@arshaw Managed to fixed my issue by using initialEvents instead of events when fetching data.

Thanks so much for posting this solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants