question

AniruddhaAditya-3867 avatar image
0 Votes"
AniruddhaAditya-3867 asked ·

spfx banner issue

69532-issue.png



I have created an SPFx banner as attached. The issue is that I see multiple banners pops up as SharePoint site at times pulls from the history. When I do a refresh, then the single footer and banner appears.

I would like to know why the issue is and how to get it resolved.

Please refer my attached image.

Thanks

office-sharepoint-online
issue.png (47.2 KiB)
· 1
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AniruddhaAditya-3867 ,
What browser are you using? Could you provide more information to help us reproduce this issue?

0 Votes 0 ·
AniruddhaAditya-3867 avatar image
0 Votes"
AniruddhaAditya-3867 answered ·

@AmosWu-MSFT Yes. This issue is resolved. by using a weired code as below
if (DuplicateChecker == 1) {
this.renderBanner();
DuplicateChecker = 2; //This is to stop duplicate banner appearing when page loads from cache
}
}

·

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Glad to hear this.

0 Votes 0 ·
AniruddhaAditya-3867 avatar image
0 Votes"
AniruddhaAditya-3867 answered ·

@AmosWu-MSFT .

I am using Chrome 88.0.4324.150 (Official Build) (64-bit) and IE also. This issue comes when SharePoint loads the page from the history/cache.

Thanks
Aniruddha

· 3 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I created an application customizer extension example in the SPFX document, but I did not successfully reproduce your problem. You can try to clear the browser cache. If it is convenient, please provide your spfx for testing. If there are some private information in the code, please delete or replace them with other words.

0 Votes 0 ·

@AmosWu-MSFT

Here is the code attached.

Thanks
Aniruddha70002-spfx.txt


0 Votes 0 ·
spfx.txt (23.0 KiB)
AmosWu-MSFT avatar image AmosWu-MSFT AniruddhaAditya-3867 ·

Please provide CSS code. Thank you.

0 Votes 0 ·
AniruddhaAditya-3867 avatar image
0 Votes"
AniruddhaAditya-3867 answered ·

@AmosWu-MSFT

pfa the css file69965-css.txt



css.txt (9.2 KiB)
· 2 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

What are the columns and values in the two lists of BannerConfigration and BannerMessages?

0 Votes 0 ·

It is a custom list with title and another column with Single Line of text.

0 Votes 0 ·
AmosWu-MSFT avatar image
0 Votes"
AmosWu-MSFT answered ·

HTML code of the header has been printed. You could check the number of times the header HTML code is printed and whether the printed content is the same in the console window of the browser developer tool.
I suggest you debug on the browser to see if there are logic errors in the code.


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AniruddhaAditya-3867,
Would you please provide us with an update on the status of your issue?

0 Votes 0 ·