• Resolved maltmann

    (@maltmann)


    I’m using this great TOC for my technical articles (posts).

    When editing a longer post in Gutenberg editor, the block keeps rendering all the time, making the edit experience quite laggy and annoying. The page content also keeps jumping around vertically.

    It would be a great improvement to have a toggle “Don’t render in Gutenberg” either in the existing “Advanced Features” meta box of the block, or as a global setting in Settings > SimpleTOC.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Marc Toensing

    (@marcdk)

    I understand the problem. Maybe this helps while there will be a better solution in the future https://www.ads-software.com/support/topic/block-editor-scrolls-intermitttently-with-simpletoc-enabled/

    Thread Starter maltmann

    (@maltmann)

    Thank you for linking that other thread.
    The longer autosave interval is a temporary solution for me.

    I’m still hoping for a better final solution …

    Plugin Author Marc Toensing

    (@marcdk)

    me too ?? it is not that easy to do as it seem. Maybe someone else has an idea and a pull request.

    Thread Starter maltmann

    (@maltmann)

    Just an idea.
    Not yet tested, because I don’t have a node setup ready to build the block.

    edit.js, ~line 34

    const { returnisSaving, returnisSavingNonPostEntityChanges, returnisAutosaving } = useSelect(
    		( select ) => {
    			const { isSavingPost, isSavingNonPostEntityChanges } =
    				select( editorStore );
    			return {
    				returnisSaving: isSavingPost(),
    				returnisSavingNonPostEntityChanges:
    					isSavingNonPostEntityChanges(),
    				returnisAutosaving: isAutosavingPost(),
    			};
    		}
    	);
    

    edit.js, ~line 345

    	return (
    		<div { ...blockProps }>
    			{ controls }
    			{ controlssidebar }
    			{ (returnisSaving || returnisSavingNonPostEntityChanges) && !returnisAutosaving ? (
    				<Spinner />
    			) : returnisAutosaving ? '' : (
    				<ServerSideRender
    					block="simpletoc/toc"
    					attributes={ attributes }
    				/>
    			) }
    		</div>
    	);
    • This reply was modified 10 months ago by maltmann.
    Thread Starter maltmann

    (@maltmann)

    Ah, sorry, that would probably render the block empty on autosave ??

    Plugin Author Marc Toensing

    (@marcdk)

    without a tested pull request it will be hard to just copy over some code. My idea would be to work with a refresh that keeps the current toc elements intact and does not remove it while data is being fetched.

    Thread Starter maltmann

    (@maltmann)

    Agree on both.

    @maltmann, a pragmatic workaround is also to wait inserting the TOC until when you are done editing. I’ve put the TOC block in a group container for a background colour, and saved it as a pattern, so inserting it after editing is quickly done.

    If I’m doing a major edit, I might even delete the existing TOC, make my edits, and insert it back in. It is not perfect, but I still prefer SimpleTOC over the other solutions I tried.

    Thread Starter maltmann

    (@maltmann)

    @oldrup, thank you, but that’s too pragmatic for me ??
    I’m editing existing log posts quite often, and if I would remove the TOC until I finished editing, I would need to re-apply all the individual settings.

    The temporary work-around by prolonging autosave interval works absolutely fine for me.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Option for not rendering in Gutenberg editor’ is closed to new replies.