For questions about Lightning Web Components (LWC) - the UI framework for the Salesforce platform. When using this tag also include the more generic [salesforce] tag.
Questions tagged [lwc]
503 questions
0
votes
2 answers
variable values undefined in LWC - JavaScript
I have declared a const 'offset', and when I try to fetch this and update in a function , the value is undefined. Hence I wont be able to add value to const. Below is sample code
import { LightningElement, wire, track , api } from 'lwc';
import…

Suhas Jain
- 43
- 1
- 7
0
votes
1 answer
Why isn't my LWC passing the values on submit to my apex class?
I've created an lwc that is called in a flow, but when I run it the form doesn't submit and the values aren't passing to the apex class. I can't figure out why.
The form allows me to populate the fields when I run it from the opportunity, but when I…

KLWRK
- 1
- 2
0
votes
2 answers
Make LWC Display Different Body Messages Based on Picklist
I have started the LWC below. I am attempting to clean up our rich text screen components on a lightning page. Currently there are over 12 different components based to show on a picklist value. I want to condense those into one LWC. So if Picklist…

Tristan Nohrer
- 97
- 12
0
votes
1 answer
LWC perform querySelector on DIV from @wire
I have an LWC as a quick action in Global Actions.
A wire method is executed, and in the data block I execute another method which performs a querySelector on a div.
The first time I open the quick action LWC, the querySelector is performed…

Guy BD
- 69
- 1
- 3
- 10
0
votes
1 answer
Auto play is not working in the lightning carousel
i got this code from http://www.lightningdesignsystem.com/components/carousel/#About-Carousel. it was supposed to do the auto play function but it is not working, even the round buttons are also not working. am i missing something?
i also know about…

Gaurav Kumar Pandey
- 33
- 3
0
votes
1 answer
How to Include Global Styles in LWC System
I'm working on a customer service system using Salesforce Lightning and the Lightning Web Component (LWC) framework. What's the best way (if any) to include a global stylesheet to create/override styles on the site? Something that will enable…

jbyrd
- 5,287
- 7
- 52
- 86
0
votes
0 answers
Jest test for a function which return Boolean only
I am new bie on Lightning web component and writing jest test for one of function written in LWC js file. I have below function code
import { LightningElement, api } from 'lwc';
export default class Example extends LightningElement {
…

kailash gaur
- 1,407
- 3
- 15
- 28
0
votes
1 answer
Not able to initialize XSLTProcessor constructor in javascript
I am using LWC framework to develop the component. It's built on ES6 Standard. I am trying to use XSLTProcessor for one of my requirements but it's giving me an error.
Failed to construct 'XSLTProcessor': Please use the 'new' operator,
this DOM…

Shaggy
- 5,422
- 28
- 98
- 163
0
votes
0 answers
How to removed canvas element event listeners
In canvas I draw line,rectange,triangle. canvas listener mousedown add two event listeners mousemove,mouseup. In listener mouseup event want to remove listeners mousemove,mouseup.
Add listener works, but removed listener not work.
Listner add on…

shamim
- 6,640
- 20
- 85
- 151
0
votes
1 answer
How to stop conversion of the timezone on new date object in javascript lwc?
I receive a datetime string with different timezones (for example '2020-10-28T08:00:00+10:00, 2020-10-28T11:00:00+11:00'). When I create new date object, it converts the string to the current User timezone, displaying different date and time on UI…

Kanikala
- 15
- 1
- 5
0
votes
1 answer
Is there a way to change a font color in Lightning input rich text field when maximum character limit is exceeded in LWC JS?
I'm trying to get the character count and on that basis want to change the color of font.
I have tried with queryselector() but it is not working:
handleChange(event) {
if( this.charCount > 100){
let textcolor =…

user14451028
- 1
- 1
- 1
0
votes
0 answers
Highcharts : Mouse Over on Legend throwing error in LWC Component
when mouse is over the legend it is throwing an error as "Uncaught TypeError: Failed to construct 'MouseEvent': member sourceCapabilities is not of type InputDeviceCapabilities.
throws at…

SFDC Person
- 1
- 1
0
votes
1 answer
Static Resource Image is not displaying in LWC
I'm unable to display the static resource Images in HTML by using LWC. Below is the file. Please guide me to fix this issue.
HTML
JS File
import { LightningElement,track } from 'lwc';
…

Tech Skill
- 25
- 1
- 7
0
votes
1 answer
How to get cursor position in lightning input rich text in lwc?
Sommeone please tell on how to get get cursor position in lightning input rich text in lightning web component.
I am using the following code but getting undefined:
let element =…

Subham Middha
- 1
- 1
0
votes
1 answer
What's the best practice to implement localization (for strings) in Salesforce's LWC?
I'm new to Salesforce's Lightning Web Components, and I'm trying to figure out what the best way to support localizing labels, messages, and other strings in LWC.
I've learnt about the i18n programmability to localize Date/Time format, Currency…

user392005
- 131
- 2
- 10