Hi
Yes…
A person who had the same problem proposed another solution on the forum :
I ran into the exact same problem today after upgrading LuckyWP Table of Contents on a local site.
I hope it’s ok that I share this here as a possible alternative work-around for others who might search for the issue. Please let me know and my apologies if not.
In my case, I wanted to keep the GP smooth scroll functionality for my site. Using the steps below, I was able to have fully functioning smooth scroll for both LuckyWP ToC and my site, using only the GP smooth scroll function.
First, ensure GP Smooth Scroll is enabled in Customizer > General.
Next, disable smooth scroll in the LuckyWP plugin settings by unchecking “Enable” in General > Behavior > Smooth Scroll.
I then placed the following PHP snippet (modified from GP Documentation) into my child theme’s functions.php file:
add_filter( 'generate_smooth_scroll_elements', function( $elements ) {
$elements[] = 'a[href*="#"]:not([class*="lwptoc_toggle_label"])';
return $elements;
} );
This applies GP smooth scroll to all hash links on the site, except for the “show/hide” toggle link of LuckyWP Table of Contents. This prevents the page from scrolling to the top when showing or hiding the table, but still scrolls from the links in the table.
Seems to be working great without any errors here anyway.