sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

sp-amplify page assembly loading rogue style rule

Open jimmywim opened this issue 6 months ago β€’ 17 comments

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:

Image

This is being caused by this style rule:

Image

And this rule is being introduced by sp-amplify:

Image

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

  1. Add any component that uses HTML table cells (td and th)
  2. Observe the style rules applied
  3. 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.

jimmywim avatar May 06 '26 08:05 jimmywim

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.

Ashlesha-MSFT avatar May 06 '26 11:05 Ashlesha-MSFT

@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!

Ashlesha-MSFT avatar May 06 '26 13:05 Ashlesha-MSFT

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).

jimmywim avatar May 06 '26 13:05 jimmywim

We are encountering similar problem with @fluentui/react DatePicker control in our custom solution:

Image

And even standard call-out after successful deletion of item is stretched across a page:

Image

(we do have a field customizer registered on this list, so it forces older style view rendering)

ltdu avatar May 07 '26 08:05 ltdu

@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 avatar May 07 '26 11:05 Ashlesha-MSFT

@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

Image

jimmywim avatar May 07 '26 12:05 jimmywim

@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.

Ashlesha-MSFT avatar May 07 '26 14:05 Ashlesha-MSFT

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.

jimmywim avatar May 07 '26 15:05 jimmywim

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.

Image

Thanks!

mbice avatar May 11 '26 15:05 mbice

Same problem in our tenant for SPFx Solutions with PnP and Fluent components as well as SharePoint out-of-the box calendars.

chr-sad avatar May 14 '26 17:05 chr-sad

@Ashlesha-MSFT are there any updates on this one? We are getting reports from clients seeing this issue in GA, now.

mbice avatar May 21 '26 17:05 mbice

@mbice, I've tagged the engineering team for an update. I’ll get back to you once I hear from them.

Ashlesha-MSFT avatar May 22 '26 04:05 Ashlesha-MSFT

We are also experiencing this with our SPFx web parts. Sudden changes to global table styles.

jacksonv1lle avatar Jun 02 '26 06:06 jacksonv1lle

Same problem for us, please fix ASAP, causes usability issues.

bmartel-cyber avatar Jun 08 '26 19:06 bmartel-cyber

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 avatar Jun 11 '26 04:06 Ashlesha-MSFT

@Ashlesha-MSFT confirmed this is now working for us. Thanks!

mbice avatar Jun 24 '26 23:06 mbice

Can be closed @Ashlesha-MSFT

jimmywim avatar Sep 08 '26 13:09 jimmywim