-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Tabs "More Views" doesn't work if tabs component is at a Y position that's below the height of the viewport/frame #11829
Comments
I have also this issue on 13.1.2. Works fine when zoom out. Note that LegacyTabs does not have this issue. |
I haven't dug too deep into the code, but my guess is something is wrong here:
From what I understand this is the handler for when you click on the "More Views" button. I wouldn't expect that the tabToFocus should change to the first hidden tab, just by clicking this. As it's hidden, it may be having trouble finding it and hence the scroll position goes to a default position (e.g. top of screen), causing the popover to also disappear, as for a moment it goes out of view. |
Sure enough, removing the |
+1 having this issue as well, tabs unusable |
Any word on this one? Seems like a potentially basic fix. The Tabs are unusable at the moment if they're under the fold. At a point where I need to replace them with some custom component (or LegacyTabs) in order to submit an app to the Shopify app store. @shopify-admins |
Hey @fabregas4 it's been a hot minute since i've worked on Polaris, but I don't mind looking into the issue. |
@fabregas4 I need to do a little more testing, but I put up a pull request with the fix here. |
Thanks @AndrewMusgrave, much appreciated! Hope it makes it into a release soon |
Summary
When using "Tabs" component in a Shopify embedded app, if you have more tabs than can fit in the container horizontally, it automatically adds a "More Views" button, which when clicked, normally shows a popover with the list of remaining tabs for you to click.
However, this basically only works if the tabs are positioned near the top of the page.
To simulate this just set up a simple route/page with:
and pass it a bunch of tabs - enough for the "More Views" button to appear.
Assuming your embedded app frame is < 4000px tall, you'll need to scroll to get to the tabs.
When you click "More Views" the popover doesn't appear.
Actually, a very quick flash occurs. It appears as if it is jumping to the top of the page, then back down to position, very quickly.
Now update the 4000px to 200px. The "More Views" button works fine again. It shows a popover with all the extra tabs listed.
The point at which it breaks seems to be when the tabs component is positioned just outside frame view. I.e. if it requires any vertical scrolling to reach it.
If I had to guess - it seems like the click is jumping the scroll position to the top for an instant, which would take the popover outside of the field of view, which perhaps triggers the popover to be automatically closed.
Another way to validate this is to Zoom Out on your browser, enough so that the tabs appear on the screen without scrolling. Now click the "More Views" button, and it works fine.
Expected behavior
No response
Actual behavior
Wrap animated gifs/videos in a details tag:
Summary of your gif(s)
Steps to reproduce
Link to sandbox
1.
2.
3.
Are you using React components?
Yes
Polaris version number
12.21.0
Browser
Chrome
Device
Windows PC
The text was updated successfully, but these errors were encountered: