Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [lightning-web-components]

This tag is for questions related to JavaScript, CSS, or Markup when used in the Lightning Web Component (LWC) programming model, or for questions of interoperability between LWC and the original Aura-based lightning components.

0
votes
0answers
24 views

lightning-input-field [Lightning Web Components]

I am currently trying to make a table where I use the lightning-record-edit-form. I am trying to make the helptext icon disappear (without deleting it on the field itself), without any luck.. Can ...
3
votes
2answers
57 views

Loading the leaflet Map in Lightning Web Component

When I am trying to load the lightning web component map is not loading. <template> <div id="map" lwc:dom="manual"></div> </template> import { LightningElement,api } from '...
1
vote
1answer
36 views

How can we expose a lightning web component on a Mobile app?

As lightning web component do not support currently (spring 19) in lightning out. How would one expose the component On a native mobile device? Is it possible?
1
vote
1answer
21 views

Lightning Community Does Not Support pubsub for Lightning Web Components?

Has anyone successfully used the pubsub module from lwc-recipes to enable inter-component communication in a Lightning Community? The registerListener function in the pubsub module throws an error ...
1
vote
1answer
24 views

Access all label from one import in component(LWC) [duplicate]

I am trying to access label in a component(Lightning web component). import greeting from '@salesforce/label/c.xxxx; import greeting from '@salesforce/label/c.yyyy; ... I want to access all labels ...
4
votes
1answer
28 views

Handle AuraHandledException in Lightning Web Component

Let's say I have an apex method like such: @AuraEnabled public static void myMethod(String myString){ if (String.isBlank(myString)) { throw new AuraHandledException('Not Cool Bro.'); }...
0
votes
0answers
19 views

Bind Lightning Web Component SObject Variable to Input Text Area

I am trying to migrate an Aura Component to a Lightning Web Component. I am storing an sobject called "Approval_History__c" as a @track property called currentUsersHistory I have an input test area ...
4
votes
1answer
61 views

Use void Apex method in Lightning Web Component

I am trying to migrate an Aura component to a Lightning Web Component. @AuraEnabled public static void updateRecords(Id recordId, String newStatus){...} I have a public static void apex method which ...
2
votes
0answers
32 views

querySelector not getting element in lightning web component

I am creating a popover, where I need to position it correctly based on the button's position that triggered it. It starts like this: <div id="popoverWrapper" class="popover-wrapper" style={...
-1
votes
1answer
32 views

Using HTML skills in development [on hold]

I have knowledge of HTML / CSS and some basics of JavaScript, where and how can I use this knowledge in developing on the Salesforce platform? I know VisualForce and Lightnin Web Components use HTML. ...
0
votes
2answers
38 views

Add Lightning Web Component to Lightning Tab

I am trying to figure out how to add a Lightning Web Component to a Lightning tab. I have it on the Home Page, but I would like it to be on its own tab. I feel like there should be an option to ...
4
votes
0answers
29 views

LWC: Add a region in custom community theme

I would like to add a region in my custom community theme. For now I am only able to add my LWC components in the body area and would like to know how I can declare regions in my theme to accept LWC (...
1
vote
0answers
45 views

jsPDF and Salesforce Lightning Web Component

I'm trying to create a Salesforce Lightning Web Component to create a custom Quote PDF using jsPDF. I mastered to use the external chart.js library with uploading it as a static resource, but when I ...
0
votes
0answers
60 views

refreshApex on detail page change [duplicate]

My Health Check(lwc) which displays data from an account record which is displayed in its standard detail page. And that i want to refresh the Health Check LWC whenever there's a change on the account ...
5
votes
2answers
73 views

How to convey LWC's complex Reactive property back to markup?

From SF docs: There are some limitations on the depth of changes tracked for rerendering in reactive properties. The tracking depth depends on the type of the reactive property. Lightning ...
0
votes
0answers
25 views

Custom detail page should open when I click submit button in my custom contact page in lightning

I have a lightning component for detail page..When I click Create Contact button,a popup page will be opened.After filling the fields the page should navigate to custom detail page InputPopuppage:: ...
0
votes
0answers
44 views

Add Row in LWC datatable [on hold]

I Want to add a new row on button click event in a lightning data table in Lightning web component.
10
votes
2answers
192 views

CSS animation in LWC not working

I'm unable to get a simple css fade-in-out text animation to work in LWC. The text displays on the page okay, but it does not fade in/out like expected. It seems as though the keyframes are getting ...
5
votes
2answers
93 views

How do I invoke a value change handler in LWC?

Is there a way in LWC to declare an attribute value change handler like there was in Aura? My use case is that I have a pager component which has 2 @api properties. When either of the @api values ...
0
votes
1answer
31 views

Lightning Web Component Invalid Field Highlight Issue

I have added some controls on LWC component. All fields are required as per requirement. I want to highlight only control not label on submit click. Right now with below code it is highlighting both ...
1
vote
1answer
29 views

Unable to upload a managed package with a generic error

I have added a component that is basically the same as provided demo here: https://github.com/Gurenax/sfdx-lwc-fullcalendarjs to my dev org. I have then referenced it in another LWC component and put ...
1
vote
2answers
28 views

Assign content to multiple slots in LWC: how to insert the same slot content to multiple template slots in LWC?

I want to build a custom configurable interface to pass two buttons to header and footer of a standard card element. So, I have a component card with card template <template> <lightning-...
4
votes
1answer
95 views

How to show hyperlink in LWC toast

I have created a LWC that executes a call to the controller and shows a toast message if the call fails: const event = new ShowToastEvent({ title: "Error", ...
0
votes
0answers
36 views

LWC - 2 Qs please .. How to get postMessage? How to rerender component if the record is updated? [closed]

In a nutshell I render (successfully) iframe based on a (Acc) record details. I tried different approches but fail to do these 2: 1- How to handle a possible postMessage from the nested iframe? I ...
1
vote
1answer
31 views

Document.fullScreen API implementation in Lightning Web Components(LWC)

I was trying to achieve full screen on an element in Lightning Web Components but was unable to use Document.fullscreen API. I tried var elem = this.template.querySelector('svg'); if (elem....
1
vote
1answer
22 views

Arrange Lighning layout in LWC so that children occupy all the space

Standard layout component <lightning-layout> from Lightning Design Bundle in LWC provide several options to arrange children components: using horizontal-align="spread" would spread children ...
1
vote
1answer
47 views

data Binding in lightning web component

I am having two component databindingparent and databindingchild. I have input text in child when I enter value I am getting the value and on click of button firing event passing to parent and showing ...
3
votes
2answers
76 views

LWC - How to get label name of buttons

I have been trying to open a modal window onclick of a button menu. The modal will be child of the parent lwc and will be hidden. Its passed with some values <lightning-button-menu class="slds-m-...
0
votes
1answer
32 views

Recreating lightning-button with custom color

I am trying to replicate lightning-button in my Web Component because I need to use custom colors, and supposedly you can't override the lightning-button with css to change these colors... So here is ...
0
votes
1answer
28 views

Changing colors of lightning-button

How can I change the colors of lightning-button? I tried doing this in my css: .my-button { background-color: #14a6bc; color: #ffffff; } and applying that class to my <lightning-button&...
0
votes
1answer
40 views

Lightning Web Component displaying cached source from previous deploy

During development of Lightning Web Components I have seen on multiple occasions an issue where the compiled source in the browser does not match the source deployed to the org, but instead matches an ...
0
votes
1answer
72 views

Call to Apex method accepting an Integer parameter imperatively from LWC

I am trying to call an Apex method imperatively from LWC. The method accepts an Integer parameter. When I call this Apex method using a wired method it works fine, without any error. But when I call ...
0
votes
1answer
38 views

Web Component can't find variable `require`

I am trying to use the json2csv javascript package in my Salesforce Web Component, but I get the error: can't find variable 'require'. I've uploaded the json2csv package as a static resource and am ...
1
vote
1answer
104 views

LWC Community recordId undefined

I am very new to Salesforce and I am stuck using LWC with communities. The problem is simple: I generated my record list and when I click on the record I would like to access the selected record ...
3
votes
1answer
77 views

Array.push() won't update Lightning Web Component View

We are migrating over to Lightning Web Components in the last couple of weeks now and we had some struggles with the arrays in Javascript. On a trackable array, when I call push in a wiredMethod, ...
3
votes
1answer
59 views

Lightning web component slot is not working inside select?

I'm trying to create a simple lightning web component that wraps a <select> element, using an unnamed slot to populate the options. However, the options are not being rendered. If I inspect the ...
0
votes
1answer
31 views

Finding icon-names for Web Component lightning cards

In an example of creating a lightning web component, the html used a lightning-card tag. Within that tag, it declared a title and icon-name, where the icon pointed to custom:custom19 <template> ...
1
vote
0answers
27 views

LEX becomes unresponsive when debugging (adding breakpoints) to loaded static resources

Using Chrome - Version 72.0.3626.121 I often find myself integrating 3rd party libraries and while attempting to do so in LWC's errors are not uncommon, so, I check the errors and using the ...
0
votes
3answers
52 views

Not able to call Composite REST request from LWC

I am trying to call Composite Request from LWC class (.js) using fetch function. But it is not working. Actually i wanted to upload 10MB File without Parent which is not possible right now in LWC. So ...
1
vote
1answer
44 views

Is there an equivalent to $A.get(“$Browser.formFactor”) in LWC?

We want to perform different logic in our LWC component js controller if the user is viewing our app in mobile. With aura components, we could do: if ($A.get("$Browser.formFactor") != 'DESKTOP') { ...
2
votes
1answer
61 views

Feasibility to import entire LWC classes to access @api methods

I'm looking to modularize my LWC without having to embed them in the template. Ideally, would this kind of pattern be feasible? I'm not sure if it's my lack of ES6 knowledge (modules) or that LWC ...
1
vote
1answer
111 views

When do @wire methods run (LWC)?

General question about Lightning Web Components: if I define a wired javascript method (in this case wired to an apex method), when does it run? And when does it run initially? Here's what the ...
1
vote
1answer
50 views

Child to grandparent communication in LWC

I am providing below the snippets of child, parent and grandparent component, where the child is contained inside the parent component, and the parent is contained inside the grandparent component. ...
3
votes
1answer
75 views

LWC: Attaching event Listener Programmatically not working

Has anyone been able to attach event listener programmatically? I defined handleClick function in child component as follows: handleClick(event) { event.preventDefault(); const selectEvent = ...
1
vote
1answer
53 views

Pass data from parent to child in lightning web component using Charts Js

I recently ran into a problem using Charts JS in Lightning web components. I wanted to share a solution I found for those who run into problems How to manually handle data changes in a child ...
1
vote
0answers
16 views

Aligning D3 Area Chart X-Axis Ticks correctly [closed]

I am building an area chart using the D3 Library, and I used their area chart example to help me construct it. However, I am not using dates as along the x-axis, instead I am using Strings, so I tried ...
0
votes
0answers
48 views

lwc quick action from Opportunity page(aura:component) and not getting @api recordId

I have created lwc component and called from aura(action button) and @api recordId null. i want to default OpportunityId to competitor object <aura:component implements="force:hasRecordId,force:...
0
votes
0answers
35 views

Property “selectedContact” of [object:vm undefined > (51)] is set to a non-trackable object

In Lwc-recipes, there is a component eventWithData. So there is this code: import { LightningElement, wire, track } from 'lwc'; import getContactList from '@salesforce/apex/ContactController....
-2
votes
1answer
50 views

Lightning Web Component [duplicate]

Is this the right time to start switching to Salesforce's new Lightning Web Component model (Is this perfectly compatible with Lightning Aura model, Lightning Data Service, Lightning Design System ...
2
votes
2answers
78 views

Lightning Web Component embedded in Visualforce Page via Aura Component and App not displaying

I am writing a lightning web component that is going to be used in Salesforce Classic, Lightning Experience and an Employee Community. It does not HAVE to be a lightning web component - I could use a ...