-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Labels
Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.sharepoint-developer-supportsharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.
Description
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
- Chrome 140.0.7339.81 (Official Build) (64-bit)
- 1.21.1
- 18.18.1
Describe the bug / error
When selecting web parts on the page in Edit mode (doesn't matter which one), theme changed event is called in my custom web part, triggering render
. This happens every time when focus changes from one web part to another.
eval @ VM2488:1
render @ CustomWebPart.ts:93
i._internalHandleThemeChangedEvent @ sp-pages-assembly_en…0cc25137d4d7.js:299
(anonymous) @ sp-pages-assembly_en…00cc25137d4d7.js:23
e._raiseEventInternal @ sp-pages-assembly_en…00cc25137d4d7.js:23
e.raiseEvent @ sp-pages-assembly_en…00cc25137d4d7.js:23
e._raiseEvent @ sp-pages-assembly_en…0cc25137d4d7.js:275
e._setTheme @ sp-pages-assembly_en…0cc25137d4d7.js:275 // <------ this triggers theme changed event

Steps to reproduce
- Open page in Edit mode
- Select your custom Web Part (it should trigger re-render and theme changed event)
- Select any other Web Part on the page, e.g., Quick Links
- Your custom Web Part's render method is called
Expected behavior
No re-renders in web parts that are not focused.
Metadata
Metadata
Assignees
Labels
Needs: Author FeedbackAwaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.Awaiting response from the original poster of the issue. Marked as stale if no activity for 7 days.sharepoint-developer-supportsharepoint-developer-supportsharepoint-developer-supporttype:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.Suspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.