-
Notifications
You must be signed in to change notification settings - Fork 990
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
Command Set onInit is executed only once #6116
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
A fix has been applied to a similar issue... see #6611... can you verify if this resolved your issue? |
I created this example because I had the issue mentioned in #5704. That is working (oninit is firing when navigating in the quicklaunch) now so this issue can be closed. |
I have tested on one of my older tenants and there I still see the oninit() is fired only once when switching between lists in the quicklaunch. Does this mean that this is by design? And I should use another route to display a item command button in my list? |
@waaromikniet - sorry for the long delay. |
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 |
Category
Describe the bug
The oninit() for my command set is only executed once. This happens after navigating to another list and go back to my original list.
Is this behavior by design? Or is this a bug that I found. I only wan't to enable my custom command set on specific list so I use the oninit() at this moment to do this. But this breaks when switching lists through navigating in the quick launch. When doing a hard refresh with CTRL+F5 the oninit() is fired again.
Steps to reproduce
Create 2 custom lists
Add both to quick launch
Create a Hello World Command Set example with console.log() in the oninit()
Deploy the solution
Click on list 1 in the quick launch and see a console log
Click on list 2 in the quick launch and see a console log
Now click again on list 1 in the quick launch. There is no oninit in the console.log.
When setting a breakpoint in the oninit() see it isn't called
Expected behavior
When I click on list 1 in the quick launch I see a console log
When I click on list 2 in the quick launch I see a console log
When I now click again on list 1 in the quick launch I want to see a console log oninit()
I use the oninit() to enable of disable the command on specific list with specific contentypes.
So I want to use the oninit() to do this.
Environment details (development & target environment)
Windows 10
SharePoint online
Node V10
Browser: Chrome
VSCode, SpFx 1.10
The text was updated successfully, but these errors were encountered: