Skip to content

md-tab: iframe reloads on tab focus #5239

Closed

Description

@anupvarma

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?

Activity

  1. tulinisarg commented on Jun 20, 2017

    @tulinisarg

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

  2. jelbourn commented on Jun 20, 2017

    @jelbourn
    Contributor
  3. anupvarma commented on Sep 13, 2017

    @anupvarma
    Author

    @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

  4. jelbourn commented on Sep 13, 2017

    @jelbourn
    Contributor

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

  5. ShubhenduVaid commented on Feb 12, 2018

    @ShubhenduVaid

    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.

  6. Mojo1 commented on Feb 23, 2018

    @Mojo1

    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

  7. ShubhenduVaid commented on Feb 23, 2018

    @ShubhenduVaid

    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.

  8. angular-automatic-lock-bot commented on Sep 8, 2019

    @angular-automatic-lock-bot

    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.

  9. locked and limited conversation to collaborators on Sep 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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