Questions tagged [lwc-dom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 views

How do I turn this array into one array in LWC?

ExampleArray = [["Relationship", "Subscriber"], ["memberId", "12345"], ["MemberName", "Test Member"]] How would I turn the above into just ...
-1
votes
0answers
28 views

need to manipulate the lightning-tree-grid, using this component for the user to make any changes [closed]

this.gridData = [ { name: '123556', GroupName: 'Ungrouped sites', _children: [ { name: '123556-...
-1
votes
0answers
31 views

how to delete selected row from a lightning tree grid component [closed]

Need to delete rows/child nodes from lightning-tree-grid and add it to another parent level:1 node. Is that possible?
0
votes
1answer
19 views

Sending an event when window.location.href changes

My setup: I have a LWC which is placed in Shared Footer, so I don't have to add it manually on every page. This component is responsible only for sending events. What problems do I have: I need to do ...
1
vote
1answer
25 views

How to Dynamically Change Text Based on User Input

I am fairly new to SF, and I am only moderately well-versed in JS in general. I am attempting to create a LWC that will display a URL based on user input. This URL will eventually be used to retrieve ...
2
votes
2answers
75 views

LWC: Get Button Element in JavaScript from LWC

Scenario: I have a LWC with a lightning-button which calls an action in the JS controller. Within the JS controller, I am trying to target the button element and update it's innerHTML and/or update it ...
0
votes
1answer
29 views

LWC unable to call onclick function from input element

I am new to LWC and trying to translate an existing VF page into LWC. I am trying to call an onclick function (pretty simple) but the function is not firing. Can anyone help me troubleshoot why this ...
0
votes
1answer
17 views

LWC Select component to select value based on specific value in JS not HMTL

I have code right now below that selects the value based on the selectedindex of 0 or since I only have two options. What I am trying to figure out is how to set the select value instead of by 0 or 1 ...
1
vote
1answer
27 views

LWC Select component how to default value in JS not HTMl

I am trying to default the value of the select to a specific value based on a condition so I cannot just put selected in the html. I need JS code that will automatically update it. For this though I ...
0
votes
1answer
18 views

Change border radius for <lightning-input>

Is there any way to change style for < lightning-input> in LWC (not Aura)? all I want is change the border radius and color. I could have used slds input for styling then I have to write all ...
0
votes
0answers
19 views

LWC OSS - Google Recaptcha - Shadow Dom

I'm working on implementing recaptcha into an LWC OSS app hosted in heroku. I've been succesful getting it to work using the following code. I am getting the error to add lwc:dom="manual" ...
0
votes
0answers
100 views

Calling LWC from Aura component, but LWC doesn't render when using standard button to call aura for the 2nd time

I'm fairly new to Aura and LWC altogether. I'm overriding a standard new button with an Aura Component and calling an LWC component from there. LWC component calls another LWC component from it. I'm ...
0
votes
1answer
35 views

Selection done in one iteration in lwc, is reflecting in every other iteration

I have a requirement where I have to create Opportunity line Item on click of custom button(LWC) on Opportunity. This component have multiple picklist fields. It works something like below Field "...
0
votes
1answer
87 views

LWC Lightning datatable - Conditionally disable-enable cell

I want to conditionally control the inline editing property of the Quantity column. Followed many posts Conditionally enable edit in lightning:datatable, https://developer.salesforce.com/forums/?id=...
0
votes
1answer
31 views

How to get value from Case.Account.Primary_Email__c and Case.ContactEmail from case recordID and autopopulated in To field on email page in lwc?

Controller_consumerSendEmail.cls public with sharing class Controller_consumerSendEmail { @AuraEnabled(cacheable=true) public static void sendEmailToController(String toSend, String subject){ ...
0
votes
0answers
23 views

Customer Community SelfRegister page url capture

For a customer community that I manage, I need capture the SelfRegister page's URL after a visitor landed on that page and created a customer user account, and record that to a custom field. What ...
1
vote
2answers
47 views

Are there any limitations to SVGs in Salesforce?

I am trying to display an SVG in a Lighting Web Component. I have noticed that the SVG is not rendering properly, and removing filter="url(#filter0_d)" in the g tag fixes the issue. This ...
0
votes
0answers
22 views

New Index and Old Index still same. when working with SortableJS and LWC?

I have using Sortable JS to make my component sortable and dragable. but I found the new and old index still the same one when element dragged. The component look like this following sample: bellow is ...
-2
votes
1answer
123 views

How do I pass sObject record from LWC to Apex Controller? [closed]

I need to pass the record to the Apex controller from Lightning Web Component. What would be the best way to pass the sobject record?
0
votes
2answers
183 views

LWC : onchange Handler not getting fired when @track attribute is changed

I have two lightning input in a simple LWC component having respective onchange handlers and being @tracked with respective attributes. Second onchange handler is getting fired when I update second @...
0
votes
1answer
32 views

How to validate fields programmatically in a lightning-record-form

I have a simple lightning-record-form. At the time of submit, I need to validate if the values are valid because I am implementing a "save and add next" button that saves the current entry, ...
0
votes
1answer
60 views

How to create a table with no borders using standard lightning-datatable?

I'm trying to create a table "With No Borders" using standard lightning-datatable of LWC. I'm referring to the pieces of codes given in https://www.lightningdesignsystem.com/components/data-...
1
vote
0answers
46 views

LWC - Apply a class to a div based on the state a specific user left it in

I have a LWC with a button ("Toggle Sales Coaching) that when selected toggles the slds-is-expanded class off and toggles the slds-is-collapsed class on. I would like for the component to know, ...
0
votes
0answers
28 views

LWC | Using for:each does not return {parameters} in loop

When I click in custom button I am rendering some lightning-inputs to html file depends how many records I have chosen before. If I have chosen 1 record of Service, i am rendering 2 inputs for single ...
0
votes
0answers
32 views

Switching Community Tab(Default) From button click IN LWC

Suppose we have 2 tabs in which we have 2 buttons in each tab. When we click on button1 which is in tab1. then it will open tab2. Can we do this with the default community tabs IN LWC?
5
votes
1answer
83 views

Will salesforce continue to support bringing in third party js inside lwc or not?

We have some lwc components in our app, that took advantage of bringing in third party code (in our case, jQuery, angularJs etc. We did that to bring in some legacy code inside lwc. The code was ...
0
votes
1answer
87 views

How to access LWC DOM?

Due to Shadow DOM and Locker Service, I am unable to access LWC DOM. Is there any workaround for a 3rd Party JavaScript to access LWC DOM?
0
votes
0answers
28 views

DOM manipulation using external library Add to Calendar in Lightning web components?

I am trying to do a simple add to calendar some thing like discussed in [here].(https://github.com/AddToCalendar/addtocalendar/blob/master/sample.html in LWC. I am not able to achieve the same ...
1
vote
2answers
214 views

LWC Datepicker in modal not displaying correctly

I have a requirement wherein I used <lightning-input type="date" variant="label-hidden"></lightning-input> for adding a datepicker in a modal pop up. But, the date-...
1
vote
1answer
635 views

Spring'21 Use CMS Content in LWC

I wanted to add an image ( CMS Managed ) to a lightning web component. here does my code look like TestCMS.html <template> <img data-contentkey={contentId}> </template> TestCMS....
1
vote
1answer
211 views

What is the use of event.preventDefault(); with respect to events in lightning web components. does it refer to prevent bubble phase execution

I understand that it stops the default phase of execution of the events, but what does it exactly mean. //child component.js import { LightningElement, track, api} from 'lwc'; export default class ...
4
votes
1answer
251 views

LWCs cause 10-20 seconds of lag populating a small amount of elements on the page

I have an LWC template like this: <input list="counties"> <datalist id="counties"> <template for:each={counties} for:item="county"> <option key=...
1
vote
0answers
24 views

How to pass api values starting with “on” in LWCs to create form abstractions?

In modern JS development ecosystems, we have form abstraction libraries to aid in creating of forms with rich interactivity. In my app, I attempted to do something like this: export default class ...
0
votes
0answers
163 views

iFrame contentWindow LWC

I have a LWC with an iframe inside. The iframe's src is a URL from an external system that loads a Document Editor. I want to access the contentWindow of the iFrame. var editor= this.template....
0
votes
1answer
118 views

LWC render nested component within lightning-record-edit-form

I am working on building a LWC that componentizes lightning-record-edit-form, but the form cannot evaluate the lightning-input-field when the fields are nested within another component. The basic ...
0
votes
0answers
56 views

Custom modal window in Salesforce 1 is always displaying at top of the page in LWC

I have implemented a custom modal window which opens up when I click on a td. It's working fine in desktop but when checking in mobile , the modal pop up is always coming at the top. If user is at the ...
0
votes
1answer
172 views

Fetch value using the key in lwc

I have a question regarding iteration in the js file of an lwc component I have a array of the following JSON format [{"key":"0036F00003hXBGAQA4","value":"...
0
votes
1answer
69 views

Event not getting fired from a lwc custom lookup component

I have used a custom lightning datatable which has a component displayed as a lookup customLightningDatatable.html import LightningDatatable from 'lightning/datatable'; import lookupTemplate from './...
1
vote
1answer
210 views

Cannot read property fields of undefined

I need to understand where I am going wrong in the below piece of code. The error screenshot is shown below. HTML Template:- <template> {name} </template> JS Controller:- import { ...
0
votes
0answers
104 views

Toast is not showing in LWC in community

import { LightningElement, track,wire } from 'lwc'; import { ShowToastEvent } from 'lightning/platformShowToastEvent' import Lead_Object from '@salesforce/schema/Lead'; import {...
0
votes
1answer
375 views

How to get the selected value of a picklist field in lightning combo box using template.getQuerySelector?

How to get the selected value of a picklist field in lightning combo box using template.getQuerySelector?. <lightning-combobox label={firstControllingFieldLabel} name=&...
1
vote
1answer
78 views

Get picklist values on record type(not a default) without hard-coding of record type id and object have more than one record type in Salesforce

I have a scenario where i have LWC component A and in its html it uses LWC component b (In this LWC component i have built the picklist dependency + record type). So that in component A in HTML i ...
1
vote
1answer
87 views

Unable to use lwc:dynamic directive in LWC component

How do I enable the lwc:dynamic directive or is it tied to certain release of Salesforce?
0
votes
1answer
139 views

lightning-input-rich-text component throws errors when clicking inside of the rich text area

I'm trying to follow the examples provided at https://developer.salesforce.com/docs/component-library/bundle/lightning-input-rich-text/documentation. The very first example is: html: <template> ...
0
votes
0answers
16 views

options can not be updated to combobox when changing values in promise then()

I don't know why the @track options can't bind to the combobox. but if I move the // in the then(){}, it can bind to the combobox normally. app.html <template> <lightning-combobox ...
1
vote
1answer
106 views

Lightning Web Components, Lightning-datatable / Lightning-tree-grid DOM traversal [duplicate]

With the API I managed to get this.template.querySelector("lightning-tree-grid"), but getting to any inner element returns empty proxy object. With the browser console I manage to find the ...
0
votes
1answer
131 views

Integration of tinyMce with LWC is not working

I am trying to use tinyMce Rich text editor in an application based on LWC instead of lightning-input-rich-text. I uploaded tinymce.min.js file in static resources and is using that in my component ...
3
votes
1answer
628 views

event.dataTransfer is getting undefined in JEST for dragstart

I'm trying to implement Jest tests for a module(to reorder data table rows). However, I'm unable to mimic the dragstart event. Can anyone help me to achieve the same behavior - Here is the function ...
0
votes
1answer
189 views

Page gets reloaded on CSV download in LWC

On click of a button, CSV file should get downloaded. I have used below Javascript code for same. JS: functionName(){ var anchorTag = document.createElement('a'); anchorTag.href="data:text/csv;...
1
vote
1answer
230 views

Importing third party JS in LWC is not working

I am trying to integrate tinyMCE editor with LWC. I have followed the below steps to do so; Download the tinyMCE resources and uploaded it as static resources in my org I am using the loadScript ...