question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide default innerContent in eventContent so it can be wrapped

See original GitHub issue

Unlike Tooltip.js I cannot attach the tooltip to a rendered element. The content must be wrapped inside the MUI Tooltip before rendering:

<Tooltip title="Tooltip">
  <Content>Arrow</Content>
</Tooltip>

Whereas Content has to be the original eventContent dependent on the view (month / list etc.). Then I return the Element via eventContent.

References: My issue Wordpress implementation: https://github.com/Oberhauser-Dev/gb-fullcalendar/issues/18 See eventContent hook and Tooltip workaround.

How can I get the appropriate innerContent element in the eventContent hook (e.g. via args)?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:26
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
Gustl22commented, Oct 23, 2020

@acerix This is no question, although I tried myself answer it in Stack Overflow! This is a feature request. Also related: https://stackoverflow.com/q/60062922/5164462

Means I cannot reproduce the default behavior by using eventContent (or only, if I copy big peaces of the original code)

I made a sandbox example, where you can toggle the Tooltips on and off. Off means it returns nothing, so it renders the library default content. Even without the Tooltip, you can see the difference.

2reactions
RyanEwencommented, Jun 29, 2021

Alright I managed to accomplish what I wanted to do using eventDidMount and old-school javascript DOM manipulation, in my React app

eventDidMount = (info) => {
    // adding a CSS classname
    if (info.event.extendedProps.status = 'rescheduled') {
        info.el.classList.add('rescheduled-event')
    }

    // add tooltip
    info.el.setAttribute('title', info.event.title)

    // manipulating the event title
    let titleEl = info.el.getElementsByClassName(info.view.type == 'listWeek' ? 'fc-list-event-title' : 'fc-event-title')[0]

    if (titleEl) {      
        // adding HTML
        let status = this.generateStatusHTML(info.event.extendedProps.status) 
        // eg: '<span class="status-rescheduled">Rescheduled</span>'
        
        titleEl.innerHTML = `${status} ${titleEl.innerHTML}`
    }
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

FullCalendar - JavaScript Event Calendar
Provide default innerContent in eventContent so it can be wrapped. 26. List view, custom columns. 26. Mini calendar to control main calendar.
Read more >
fullcalendar/common/main.js.map
documentElement.contains(el)) {\n return null\n }\n do {\n if ... n // if duration will change, there's no way the default duration will persist,\n...
Read more >
Editor Window Customization in JavaScript Schedule control
In default event editor window, start and end time duration are processed based on the interval value set within the timeScale property. By...
Read more >
HTML Calculated Column: solutions for SP 2010 (Part IV)
In this post I'll provide an easy answer: I don't know. ... To avoid this, what you could do is put the script...
Read more >
HTML 5.3: 11. Obsolete features
The missing value default is the scroll state. ... Whenever the < name attribute is set and the frame element's nested browsing context...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found