sp-amplify page assembly loading rogue style rule
Target SharePoint environment
SharePoint Online
What SharePoint development model, framework, SDK or API is this about?
π₯ SharePoint Framework
Developer environment
Linux
What browser(s) / client(s) have you tested
- [ ] π₯ Internet Explorer
- [x] π₯ Microsoft Edge
- [x] π₯ 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
- SPFx version
- Node.js version
- etc
Describe the bug / error
We're seeing sporadic styling issues with a PnP component, the colour picker looks like this:
This is being caused by this style rule:
And this rule is being introduced by sp-amplify:
Any chance a class selector be added to this style rule so it's not being applied to every table cell on the page, pretty please?
Steps to reproduce
- Add any component that uses HTML table cells (
tdandth) - Observe the style rules applied
- If no other rules are applied to
td&th, the sp-amplify "global" rule is applied
Expected behavior
user agent style rules applied to unstyled td and th elements on a SharePoint page.
Hello @jimmywim,
Thank you for bringing this issue to our attention. We will look into it and get back to you shortly.
If you donβt receive a reply within two working days, please use this escalation form to escalate.
@jimmywim, Thanks for reporting this. I attempted to reproduce the issue on my tenant (SPFx 1.22.2, SharePoint Online) but was unable to confirm the sp-amplify rogue [td, th { border-collapse: collapse } rule β DevTools shows user agent stylesheet as the source, which is the expected behavior.
I'll check with the engineering team to see if there has been any recent change or fix to sp-amplify on this. Will update you once I hear back.
Thanks for your patience!
Hi @Ashlesha-MSFT
Thanks for attempting - we noticed it was sometimes sporadic, perhaps when certain built in components were rendered on the page (I assume amplify relates to page sharing/boosting).
We are encountering similar problem with @fluentui/react DatePicker control in our custom solution:
And even standard call-out after successful deletion of item is stretched across a page:
(we do have a field customizer registered on this list, so it forces older style view rendering)
@jimmywim, I can confirm that sp-amplify is loaded on real SharePoint pages (sp-amplify-from-anywhere_en-us_d4aee9712d5f409c0b88.js via res-1.cdn.office.net).
However, searching for border-collapse inside this file returns no results β the rogue [td, th { border-collapse: collapse }] rule is not present in this version of sp-amplify currently served to my tenant.
This suggests the issue may have already been patched on the server side in a newer version of sp-amplify. Could you check which version/hash of sp-amplify you're seeing the issue with? The version on my tenant is d4aee9712d5f409c0b88.
@Ashlesha-MSFT
The affected rule isn't a border-collapse, it's a padding-right: 30 (or left for dir=rtl), and the assembly is in shared-components rather than anywhere.
https://res-1.public.onecdn.static.microsoft/files/sp-client/sp-amplify-shared-components_en-us_b4dbfc0e5762c95cf2c2.js
@jimmywim,
After further investigation on my tenant (M365 Developer Tenant):
- sp-amplify-from-anywhere is loaded β but contains no padding-right: 30px rule
- sp-amplify-shared-components is not loaded at all on my tenant
This confirms the issue is specific to tenants where sp-amplify-shared-components is part of the page assembly. My tenant appears to be on a different rollout ring that doesn't include this assembly yet.
Could you share:
- The full URL/hash of sp-amplify-shared-components you're seeing (e.g. sp-amplify-shared-components_en-us_b4dbfc0e5762c95cf2c2.js)
- Does it load on all pages or only specific ones (e.g. pages with sharing/boost features enabled)?
Routing this to the engineering team to investigate which page conditions trigger sp-amplify-shared-components to load and why it contains an unscoped [td { padding-right: 30px }] rule.
Hi @Ashlesha-MSFT
My last reply has the full URL to the assembly:
https://res-1.public.onecdn.static.microsoft/files/sp-client/sp-amplify-shared-components_en-us_b4dbfc0e5762c95cf2c2.js
Unfortunately I'm unable to tell which standard page component pulls in this assembly - sometimes it loads and sometimes it doesn't, hopefully engineering can shed some light.
Hi,
We're seeing the same issue across many tenants. PnP and Fluent components inheriting these globally scoped table cell styles from sp-amplify-shared-components.. Is there an ETA on when this might be resolved?
We also noticed this morning that out-of-the-box SharePoint calendars are also visually broken because of this. e.g.
Thanks!
Same problem in our tenant for SPFx Solutions with PnP and Fluent components as well as SharePoint out-of-the box calendars.
@Ashlesha-MSFT are there any updates on this one? We are getting reports from clients seeing this issue in GA, now.
@mbice, I've tagged the engineering team for an update. Iβll get back to you once I hear from them.
We are also experiencing this with our SPFx web parts. Sudden changes to global table styles.
Same problem for us, please fix ASAP, causes usability issues.
Hi all, FYI, the product team checked in a change that will fix the global style issue. That change should start rolling out to prod next week and be fully deployed in prod the week after.
@Ashlesha-MSFT confirmed this is now working for us. Thanks!
Can be closed @Ashlesha-MSFT