-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
feat(material/tabs): add the ability to keep content inside the DOM while off-screen #20393
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't think of anything strictly better than preserveContent
. "persist" is an alternative, but I don't see much of a distinction between them.
Could you update the docs with a section / example for this?
af206c2
to
6bd61e8
Compare
I've added docs and a live example @jelbourn. Can you take another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6bd61e8
to
bfd8a88
Compare
bfd8a88
to
743aed8
Compare
743aed8
to
a79ea64
Compare
a79ea64
to
51eee12
Compare
51eee12
to
4bfb174
Compare
4bfb174
to
53b4cb2
Compare
53b4cb2
to
51fa7be
Compare
What is preventing this PR from being merged? This fix was labeled "merge ready" a year ago. Please merge or provide an update. |
Looks like there was just one screenshot diff affecting this. @crisbeto I coincidentally got two requests related to this feature from Googlers this week, so I'll try to push it forward. However, what do you think of changing the input name to |
I'm not super attached to the name, but having the |
Pretty sure this will work fine but please also include a unit test with lazy-rendered tab contents - we'd want it to retain it's lazy rendering but keep the rendered content alive after tabbing away. |
@crisbeto fair enough, I don't feel strongly either way |
Hello! I'm needing this feature a lot. Is it going to be merged? |
@crisbeto this might be a good first issue for you to try to land directly in Google |
This is one of the bigger lacking features that most popular libraries' tab components have. It is essential when working with iframe content. Could this get merged? Thanks in advance ng team!! |
ca547a6
to
2482274
Compare
Looks like this is good to go and my team would really like this. Are there plans to merge this? |
Per our discovery with visibility getting overridden inside of expansion panels, please make sure to use visibility: hidden !important |
2482274
to
accd798
Compare
Pushed a similar fix to the expansion panel that adds |
i also need this feature thank you |
@crisbeto This had some conflicts with another PR that I merged in earlier today |
accd798
to
0e6bf31
Compare
I've rebased the PR. |
I'm hoping this is close to being merged? Without the ability to retain an iframe in the DOM, my project simply won't work with tabs. Thanks. |
0e6bf31
to
1f123d0
Compare
…hile off-screen Adds the `preserveContent` input which allows consumers to opt into keeping the content of off-screen tabs inside the DOM. This is useful primarily for edge cases like iframes and videos where removing the element from the DOM will cause it to reload. One gotcha here is that we have to set `visibility: hidden` on the off-screen content so that users can't tab into it. Fixes angular#19480.
1f123d0
to
dc43555
Compare
…he DOM while off-screen (angular#20393)" This reverts commit c3188c8.
…hile off-screen **Note:** this is a resubmit of angular#20393 with a minor adjustment in the animation config to fix the issue that caused it to be reverted due to an error in Firefox tests. Adds the `preserveContent` input which allows consumers to opt into keeping the content of off-screen tabs inside the DOM. This is useful primarily for edge cases like iframes and videos where removing the element from the DOM will cause it to reload. One gotcha here is that we have to set `visibility: hidden` on the off-screen content so that users can't tab into it. Fixes angular#19480.
…hile off-screen (#24299) **Note:** this is a resubmit of #20393 with a minor adjustment in the animation config to fix the issue that caused it to be reverted due to an error in Firefox tests. Adds the `preserveContent` input which allows consumers to opt into keeping the content of off-screen tabs inside the DOM. This is useful primarily for edge cases like iframes and videos where removing the element from the DOM will cause it to reload. One gotcha here is that we have to set `visibility: hidden` on the off-screen content so that users can't tab into it. Fixes #19480.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds the
preserveContent
input which allows consumers to opt into keeping the content of off-screen tabs inside the DOM. This is useful primarily for edge cases like iframes and videos where removing the element from the DOM will cause it to reload.One gotcha here is that we have to set
visibility: hidden
on the off-screen content so that users can't tab into it.Fixes #19480.