web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Field PCF: two tabs in...
Power Apps
Answered

Field PCF: two tabs in one form is loading onto the FIRST loaded container

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I'm using a field bound PCF on one form and it has on two different tabs and noticing bizarre behavior.

1. I click the first tab and PCF loads successfully.

2. I click the second tab and PCF loads but disappears 

3. I go back to the first tab and see both instances of the PCF in one container

4. The first one still has it's correct state and they are obviously difference instances of the PCF but the second attached itself to the first container 

 

It seems it is attaching to the original container when the second one is loading and not using the new container. I would've assumed the init method would've passed the new container for this tab. Any ideas on this, I'm assuming it's a lifecycle issue or old container being passed in during init.

 

My lifecycle:

public init(context: ComponentFramework.Context<IInputs>, notifyOutputChanged: () => void, state: ComponentFramework.Dictionary, container: HTMLDivElement) {
		initializeIcons(undefined, { disableWarnings: true });
		this._context = context;
		this._notifyOutputChanged = notifyOutputChanged;
		this._container = container;
}

 

public updateView(context?: ComponentFramework.Context<IInputs>): void {
	ReactDOM.render(
			React.createElement(TestPCF, this.props),
			this._container
		);
	}
public destroy(): void {
		ReactDOM.unmountComponentAtNode(this._container);
	}
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found the issue and of course it was me! Just in case anyone else skips their morning coffee:

    I had put a static <LayerHost> wrapping my components - this was for my panel to stick inside the PCF rather than stretching to the browser window. Well my second PCF stuck itself into that container as well. I took out the layering and it is correctly loading on both tabs now. 

  • Ben Thompson Profile Picture
    1,400 on at

    Thank you for coming back and telling us what the problem was.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 914

#2
11manish Profile Picture

11manish 617

#3
Valantis Profile Picture

Valantis 598

Last 30 days Overall leaderboard