Search In This Blog

2022-07-02

Get browser type in Lightning Aura/LWC

In Aura

if ($A.get("$Browser.formFactor") != 'DESKTOP') {

    // do something for mobile only here

}


In LWC

import formFactorPropertyName from '@salesforce/client/formFactor'

if (formFactorPropertyName == "Large") {

    // Large—A desktop client.

    // Medium—A tablet client.

    // Small—A phone client.

}


Increase Width of Quick Action Modal Window

Aura

Add style tag to aura component.

<aura:component implements="force:lightningQuickAction,force:hasRecordId">

    <aura:html tag="style"> .slds-modal__container { min-width: 80vw; } </aura:html>

    <aura:attribute name="recordId" type="String" required="false" description="" access="global"/>

    <c:childCmp recordId="{!v.recordId}" onclose="{!c.closeModal}"></c: childCmp>

</aura:component>


LWC

Some issue of quick action in LWC.

Can not change type of Lightning Web Component after deploy.

Can not get recordId & objectApiName at init.

Not working in mobile & Experience(Community)