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

Web part property updates causes child component to remount and lose state #8540

Closed
1 of 9 tasks
JoelBool opened this issue Oct 31, 2022 · 4 comments
Closed
1 of 9 tasks
Labels
area:spfx Category: SharePoint Framework (not extensions related) type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Milestone

Comments

@JoelBool
Copy link

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

💥 SharePoint Framework

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • browser version

Chrome 106.0.5249.91

  • SPFx version

1.14.0

  • Node.js version

v12.13.0

Describe the bug / error

When editing a page and then editing a web part property, the second edit of the web part properties causes the web part child component to remount (loosing state of the component). Any further changes after this remount works as expected.

Steps to reproduce

  1. I created a very simply webpart just to show this issue using the yo @microsoft/sharepoint scaffolding. Available here https://github.com/JoelBool/RemountingWebpart
  2. Serve the project
  3. Edit a page.
  4. Add the webpart to the page (it's named 'Remounting')
  5. Publish the page
  6. Edit the page
  7. Click the 'count' button in the webpart (basically it just increments a single number in state which is rendered above). Note that the number changes
  8. Edit the web part properties and write one character into the description input. Note that the number stays the same
  9. Continue and type another character. Note that the component remounts and that the state is lost (count set to 0)

If you can't reproduce it on the first try, try to repeat steps 5-9. I can reproduce it quite consistently and it's on the second property change that the reset happens. After that the reset doesn't happen again.

Expected behavior

The state should not be lost on web part property update. I.e. the component should not remount

@JoelBool JoelBool added the type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs. label Oct 31, 2022
@ghost
Copy link

ghost commented Oct 31, 2022

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

@ghost ghost added the Needs: Triage 🔍 Awaiting categorization and initial review. label Oct 31, 2022
@AJIXuMuK AJIXuMuK added area:spfx Category: SharePoint Framework (not extensions related) and removed Needs: Triage 🔍 Awaiting categorization and initial review. labels Oct 31, 2022
@AJIXuMuK
Copy link
Collaborator

@JoelBool - thanks for the detailed description.
I was able to repro it and will be working on it.

@AJIXuMuK AJIXuMuK added this to the 11-25-22 milestone Nov 28, 2022
@AJIXuMuK
Copy link
Collaborator

Should be rolled out globally by now

@ghost
Copy link

ghost commented Jan 17, 2023

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

@SharePoint SharePoint locked as resolved and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area:spfx Category: SharePoint Framework (not extensions related) type:bug-suspected Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Projects
None yet
Development

No branches or pull requests

2 participants