Skip to content
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

react-page-sections-navigation - Anchor labels not showing in top navigation bar on page load. #1375

Closed
stchiew opened this issue Jul 7, 2020 · 8 comments
Labels
status:wont-fix Known... but no plans to address this topic.

Comments

@stchiew
Copy link

stchiew commented Jul 7, 2020

react-page-sections-navigation

Authors

@AJIXuMuK

Expected or Desired Behavior

All labels defined in the anchor webparts in the page are displayed in the top navigation bar.

Observed Behavior

Only the Home label is display upon page load. Only after scrolling down the page, the anchor labels will start to appear on the top navigation bar

Steps to Reproduce

Steps to reproduce the behavior:

  1. Deploy the web part
  2. Add the web parts and add the anchor web parts.
  3. Save and load the page. The top navi bar displays only the Home label.
  4. Scroll down the page and other anchor labels then start to appear.

Environment Details (Development & Target environment)

  • OS: Windows 10
  • Target Environment: SharePoint Online
  • Framework: Node.js /v10
  • Browser(s): All
  • Tooling: VS Code | SPFx v1.10.0
  • Additional details:

Additional context

Seems like only when the anchor web parts come into view port only does the labels appear in the top navigation bar

@ghost
Copy link

ghost commented Jul 7, 2020

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

@stchiew
Copy link
Author

stchiew commented Jul 22, 2020

A little deep dive into this. Seems like the implementation of lazy loading of custom web parts in modern pages messes this up. The anchor web parts (data sources) located further down the page is not rendered until scrolled to, so the destination web part (nav header) does not have all the anchor text/links yet to display when the page is first opened. Only when scrolled to does the anchor web parts get rendered and the text/links are sent to the destination web part. This was tested on both Targeted and Standard release tenants.

Anyway (via code) of forcing the data sources to be rendered before being scrolled to?

Below are some images from Chrome dev tool before and after the anchor web parts come into view. Tested with a standard HellowWorld webpart as well with similar results.

Before - web part not rendered
image

After webpart rendered
image

Standard Hello World webpart at bottom of a long page- it is not rendered on page load
image

@AJIXuMuK
Copy link
Contributor

I don't think we can fix it on web part's level. So I submitted a bug to sp-dev-docs.

@JaggB
Copy link

JaggB commented Aug 12, 2020

Seems like this has broken for us too. Was working a few days ago. The Navigation Position: Top of Page Content doesn't work but Inside Section does work:

Top of page
image

Inside section
image

@AJIXuMuK
Copy link
Contributor

@JaggB - please see the referenced issue

@stchiew
Copy link
Author

stchiew commented Aug 13, 2020

@JaggB encountering your issue too, but seems to be caused by a different change. Some class names have changed in the modern page rendering, to something like div class="st_bv_k"><div class="ri_bm_k"> ...etc
The query selector looking for class*="layoutWrapper_"] classes can't find it anymore for top of page positions, so top of page nav bar doesn't show up anymore.

Inside section still works because spPageCanvasContent is still there.

Question is, is this a temp change by MS for some testing purpose, or a longer term change...

---code reference ---
// page canvas DOM element id
private readonly _pageCanvasId = 'spPageCanvasContent';
// page layout element selector
private readonly pageLayoutSelector = '[class*="layoutWrapper"]';

@KrutinP
Copy link

KrutinP commented Sep 1, 2020

I am facing a similar problem.

I am using connected webparts to dynamically populate multiple custom chart webparts based upon data range selected in the top range selection custom webpart. Due to Lazy Loading of SPFx web part, unless we scroll to the bottom of the page and let all the custom webparts load, the charts fail to render itself with the data range selected.

Will lazy Loading of SPFx cutom webparts handle problems faced in using connected webparts on same modern page

@hugoabernier hugoabernier added status:wont-fix Known... but no plans to address this topic. and removed Help wanted 🪧 labels Oct 27, 2020
@hugoabernier
Copy link
Collaborator

Closing this issue as "won't fix" because the functionality relies on system behavior that has changed.

See this issue 6091 for more information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:wont-fix Known... but no plans to address this topic.
Projects
None yet
Development

No branches or pull requests

5 participants