Skip to content

"Maximum update depth exceeded" if sticky buttons in TabSet is wider than 10px #517

@muerwre

Description

@muerwre

Describe the bug

Adding any element to renderValues.stickyButtons in onRenderTabSet causes an infinite Maximum update depth exceeded React error when the tab strip width is near a certain boundary.

Function checkForOverflow in useTabOverflow uses a hardcoded 10px offset as hysteresis to prevent oscillation between docked/undocked states, but if sticky buttons is wider than 10px that cause infinite loop of button appearance and disappearance.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Create function that contains renderValues.stickyButtons.push(<div>HELLO</div>)
  2. Pass it to layout as onRenderTabSet
  3. Scale your tabset column until tab seratator comes close to "HELLO"
  4. Experience a crash

Expected behavior

Sticky buttons width is measured instead of being hardcoded

Operating System

Doesn't matter

Browser Type?

Chrom

Browser Version

any

Screenshots or Videos

Can't produce, because of NDA

Additional context

Changing offset value from 10 to value bigger than sticky buttons width fixes that

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions