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

Scrolling should be validated when there are no tabs but sticky buttons are present #469

Open
schtauffen opened this issue Jan 14, 2025 · 0 comments

Comments

@schtauffen
Copy link

Describe the bug

Currently users can scroll tabsets when no tabs are open but there are stickybuttons persent.

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Add a sticky button such as:

<Layout onRenderTabSet={(node, renderValues) =>  {
  renderValues.push(<button>+</button>);
  }} />

Close any tabs that may be present.
Observe that you can use your mouse scroll wheel to move the sticky buttons around, even out of visibility range.

Expected behavior

We have patched flexlayout to just setPosition(0) in this scenario:

// updateVisibleTabs in TabOverflowHook.tsx (Line 96 for 18.2.0)
            if (node.getChildren().length === 0 && stickyButtonsSize !== 0) {
                setPosition(0);
            }

A better solution would validate if sticky buttons are hidden to allow scrolling but in our case disallowing it is sufficient.

Operating System

macOS

Browser Type?

Google Chrome

Browser Version

n/a

Screenshots or Videos

Prior to scrolling:
image

Sticky button scrolled into other positions:
image

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant