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

Render hooks for more popover #5869

Closed
1 task done
jbirch8865 opened this issue Sep 28, 2020 · 4 comments
Closed
1 task done

Render hooks for more popover #5869

jbirch8865 opened this issue Sep 28, 2020 · 4 comments

Comments

@jbirch8865
Copy link

Checklist

Please mark these items with an [x]

  • [X ] I've already searched through existing tickets
  • Other people will find this feature useful

Feature Description

I searched through the closed/open issues and didn't see how I can achieve this. I use the moreLinkClick callback in the event popover api to know that the popover window is being displayed. I can't seem to figure out how to detect when the user closes the popover window. I am using eventClassNames to apply a class to all non-matching events when the user hovers over an event on the main calendar but I don't want to apply the class if the user is hovering over an event in the popover window. Any advice would be appreciated.

@acerix acerix changed the title Event Popover onHide Render hooks for more popover Sep 30, 2020
@acerix
Copy link
Member

acerix commented Sep 30, 2020

Are you looking for a callback when the popover is closed, for example something like "morePopoverWillUnmount"?

If you just want to give a different styles to events that are inside the popover, you could just use CSS like this:

https://codepen.io/acerix/pen/MWyMgXe?editors=0110

@jbirch8865
Copy link
Author

@acerix - Unfortunately I can't quite figure out how to get the CSS selectors to work the way I need.
I currently have a tooltip surrounding every event with more details about that event.

When the tooltip activates it stores a custom data field (job_id) of that event in useState and then using eventClassNames: I apply a class (.event-job-hovering) to all events that do not match that job id. When the tooltip unmounts it clears the value.

Then I use CSS to hide those events so I can easily see all the days that event is on. The days aren't necessarily in a row.
.event-job-hovering {
visibility: hidden;
opacity: 0;
transition: visibility 1s linear 1s, opacity 1s linear 1s;
}

I do not want this to occur if there is the rare case that the day has events going into a popover. And I don't know how to tell while using eventClassNames if the event is going to be in the popover or not. So I'm stuck attaching that class to all events including the ones in the popover that don't match the job id that the person is currently hovering over.

So what I did is used the moreLinkClick: to track the user opened the popover, that way when the tooltip is triggered I do not apply the class. The issue is I don't know when the popover is closed to turn the feature back on.

Any help whether CSS or things I missed would be awesome thank you.

@acerix
Copy link
Member

acerix commented Oct 1, 2020

If you mean you don't want that CSS applied in the popover, you can override that style, eg. by putting this after:

.fc-more-popover .event-job-hovering {
  visibility: visible;
  opacity: 1;
}

Please refer to the support page and use Stack Overflow for help.

@jbirch8865
Copy link
Author

@acerix sounds good I'll add this to stack overflow to see if I'm missing something I could be doing to make this work.

Thanks

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

2 participants