-
Notifications
You must be signed in to change notification settings - Fork 993
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
SPFx Field Customizer - onInit executes multiple times when navigating between folders in same document library #8552
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
@AJIXuMuK, any idéa why this is happening? Is this expected behavior? Any workaround? |
@andrewconnell & @VesaJuvonen, do you guys have any insight into this? |
@SaadKnowIT - sorry for the silence. |
@AJIXuMuK - Glad to here that you are working on this. Waiting for your findings/results. |
@SaadKnowIT - the issue has been fixed and will be included in the next release. |
@AJIXuMuK, thanks for the reply and the fix. Will test it when it is released. What am i supposed to use to handle navigation events (Navigating between folders) inside the same library/list or when navigating between different libraries/lists. |
this should be rolled out worldwide by now |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
💥 SharePoint Framework
Developer environment
No response
What browser(s) / client(s) have you tested
Additional environment details
Versions:
Describe the bug / error
I am developing an SPFx Extension Field Customizer that is supposed to run in an document library with many levels of folders and documents.
The problem i am having is that the "onInit" function is executed multiple times when navigating between the folders in the document library. I am executing an request to SharePoint through the PnPJs library from inside the onInit function.
On initial visit to the document library, this is the order of how the default function execute:
If i decide to navigate in to one of these folders from this view, then this is the execution order of the default functions:
If i navigate back up to the root folder and then to a different folder (still one level down). Then this is the execution order of the default functions:
If i right click on a document or a folder in the same view as above to open the object menu, it triggers the default functions again:
This behavior i explained above continues as i navigate to a new folder in the same document library. For every new folder i navigate to, the execution count for the onInit executions increase by one.
Steps to reproduce
Create a new SPFx Extension - Field Customizer with React as a template using yo.
Add these for the console log outputs as show in my pictures above.
Add the column associated with your Field Customizer to a document library.
run gulp serve and test it against the document library.
Expected behavior
I expect the oninit function to be executed only once for each navigation event made between the folders.
The text was updated successfully, but these errors were encountered: