components icon indicating copy to clipboard operation
components copied to clipboard

md-tab: iframe reloads on tab focus

Open anupvarma opened this issue 9 years ago • 9 comments

Bug, feature request, or proposal:

Bug

What is the expected behavior?

iframe content shouldn't be reloaded every time the tab is on focus.

What is the current behavior?

iframe embedded with tab causes the iframe to reload as and when user keeps switching between the tabs.

What are the steps to reproduce?

Step 1: Create 2 tabs with having iframe in 1st tab. Step 2: Keep the iframe src to some external page (for data entry purpose). Step 3: Fill some fields in tab 1 frame. Step 4: Toggling tabs will reload iframe everytime.

Providing a Plunker (or similar) is the best way to get the team to see your issue. Plunker template: http://plnkr.co/edit/DADYadzGOFI5GqkkITkA?p=preview

What is the use-case or motivation for changing an existing behavior?

It's a bug, the existing behavior is unintended

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: 4.2.2 Material: 2.0.0-beta.6

Is there anything else we should know?

anupvarma avatar Jun 20 '17 10:06 anupvarma

I have the same issue embedding Node Red into my App. The behaviour is similar with object tag. Any help will be much appreciated.

tulinisarg avatar Jun 20 '17 10:06 tulinisarg

Not sure if this issue is related to #731 and #1472

ghost avatar Jun 20 '17 10:06 ghost

See https://github.com/angular/angular/issues/16994

jelbourn avatar Jun 20 '17 14:06 jelbourn

@jelbourn @tbosch Caching doesn't resolve the problem when the iframe is embedded within a tab.

Check the plunker updated with tabs: http://plnkr.co/edit/kA5XtZ?p=preview

Can you please suggest a work around for tabs

anupvarma avatar Sep 13 '17 09:09 anupvarma

@anupvarma it is a bug in Angular, not something that can be addressed at the application level

jelbourn avatar Sep 13 '17 16:09 jelbourn

Guys any solution to this issue. Having similar issue

<mat-tab-group>
 <mat-tab>Content 1</mat-tab>
 <mat-tab><object style="height:500px;width:1000px" data="https://www.wynk.in/music"></object></mat-tab>
</mat-tab-group>

The second tab reloads.

ShubhenduVaid avatar Feb 12 '18 17:02 ShubhenduVaid

had same issue - iframe is reloading on calendar toggle, menu toggle and so on ... every interaction This was solution: https://stackoverflow.com/questions/39429293/url-sanitization-is-causing-refresh-of-the-embedded-youtube-video

Mojo1 avatar Feb 23 '18 16:02 Mojo1

Probably the issue is that tab component is playing on the "display" value. I made a similar component which changes the "visiblity" value instead of "display" and it stopped reloading.

ShubhenduVaid avatar Feb 23 '18 17:02 ShubhenduVaid

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.