The core question is reduced and skipping the "Why do I ask this and what do I want to achieve?". Read the "Background notes" at the end, if you want to know the ugly truth...

Core question

Why LEX (Lightning Experience) is generating the markup differently for different users when it renders the very same flexipage? Sometimes it is using lots of <slot>-elements with Shadow DOMs and sometime it is creating an old style <div>-structure. The following screenshots were made from the very same flexipage on the same org and same app shot with different users (having the very same profile):

CASE old <div> style

enter image description here

CASE new <slot> style

enter image description here

Is there any way on how I can control which user get which HTML-style rendered by Salesforce? If yes: how and where can I control it?

Background notes (not relevant for the core question)

I'm not using LWCs. This is a general question. The reason why I'm asking this is because I need to get the exact height of the so called "Highlights Panel" which is a standard Salesforce component available in the designer for record pages. I need the height to implement a "Sticky Header" feature for tables we are developing as aura components. We got that using aura components without Locker Service, just to determine the damn height... The height is not constant. No way to hardcode it. It depends on the scroll-position of the page (it's shrinking and growing) and if a user has selected "Comfy" or "Compact" mode, and maybe other things, too... now our code is working only if we get the HTML served in the old style without the <slot>-elements. The reason is very clear to me: the shadow DOM is blocking my queries to determine the exact height...

And yes, I know: this is something what shouldn't be done in the first place... but still I'm curious ;-)

  • As a matter of interest, do the two users have exactly the same profile permissions and see the same components rendered? I ask because I wonder if you have some LWC component somewhere on the page including as some action or other for example (yes, you said you are not using LWC, but still want to rule it out) that gets rendered for only one of the users? It might be that as soon as some LWC component is included in the page, the whole rendering switches...? – Phil W Nov 4 '19 at 17:55
  • the users have exactly the same profiles. There are NO other components except one invisible aura componet which is only loading jquery for pure convenience reasons. If the aura component is removed, the result is exactly the same. The record page contains only the highlight panel. We compared the both user records carefully but we were not able to see any difference in the settings. – Uwe Heim Nov 4 '19 at 18:09
  • Technically you are using the impersonation admin feature "Login As" - this might be part of the reason. Is there a way you could test with both users being logged into the ORG directly using credentials? My assumption is that you will see no difference there, but I could be wrong. – Glen De Marcos Nov 5 '19 at 23:54
  • @GlennDeMarcos you are wrong. The issue came up with the user being directly logged in. What you see here is only for my testing and debugging and this question. – Uwe Heim Nov 13 '19 at 7:17
  • FYI somewhat related help.salesforce.com/… (you can imagine something like this being A/B tested) – Kristian Jan 20 at 16:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.