5 votes
Accepted

LWC: Getting original element that dispatched event that bubbles

This is the expected behavior, as specified in the documentation. When an event bubbles up the DOM, if it crosses the shadow boundary, the value of Event.target changes to match the scope of the ...
  • 462k
3 votes

Supporting guest user file upload on an LWR Site (up to 20mb)

The answer you're looking for may violate the ToS and/or MSA of salesforce.com, so proceed at your own risk. You can lose all your data, have it stolen, etc. No warranty or guarantee of fitness. ...
  • 462k
3 votes
Accepted

How to redirect to start of the flow using LWC embedded in the same flow

There is no such thing as a FlowNavigationStartEvent, but you can engineer your component and flow to cooperate to achieve what you want. I would address this by: Having an output only property for ...
  • 31.4k
3 votes

Alternate to if:false in LWC

As far as I'm aware, you are meant to use either of the two solutions. I would personally recommend flipping the Boolean value, as that is a trivial code change. This is actually similar to most other ...
  • 462k
2 votes
Accepted

How do I check if LWC component has a public method

Below approach using JS typeof operator will determine if setCustomValidity exists on the DOM element. const inputArray = this.template.querySelectorAll(".inp-cls"); inputArray.forEach(inp =...
  • 1,124
2 votes
Accepted

Usage LWC in flow returns error when package creation

The component reference in your flow is currently: <extensionName>c:navigateButton</extensionName> This needs to be updated to use the namespace prefix for your package. If your package ...
  • 31.4k
2 votes
Accepted

LWC get field value from @wire result (single object) from apex query

As you can see from the console log, data holds both Id and Name, it doesn't hold a MyObject__c object, so you should just assign data to this.record: if (data) { console.log("in @wire " ...
  • 5,639
2 votes
Accepted

Passing array to lightning-modal is being flattened

This appears to be newer behavior. I recall that objects (e.g. Array) previously always formatted as if rendered by Object.prototype.toString. This appears to be a fix to produce more readable output ...
  • 462k
1 vote
Accepted

javascript filter child object fields

This is more of a specific JS question.Since we just need to check if any one array element satisfies the condition, we can use JS some function for checking the nested array as below : const ...
  • 1,124
1 vote
Accepted

How to get logged in User's PermissionSetGroup id in LWC?

The error you're getting is: The related lists UI API currently does not support this related list Unfortunately, not all objects are supported by the UI API, and this appears to be a limitation. ...
  • 462k
1 vote
Accepted

Problem with replacing if:true with lwc:if

My HTML page contained 11 if:true tags and 1 if:false. After replacing all of these one by one, I found out that the problem was with the if:false. What I had: <template if:false={...
1 vote
Accepted

How do I mock a child LWC in a parent's Jest Unit Test?

In order to mock childComponent only in the test for parentComponent we need to: Build a skeleton stub for childComponent as a JS file. Instruct the parentComponent test to use this file instead of ...
1 vote
Accepted

Cloning the task list view datatable in custom LWC (Status value and clickable button in same column)

You can use an htm table and an apex helper class...try the code below Apex: public with sharing class GetTaskController { @AuraEnabled(cacheable=true) public static List<TaskWrapper> getTasks()...
1 vote
Accepted

JavaScript strict mode is causing my promise to be rejected and throw an error

if (reject) { reject(reject); } else { resolve(resolve); } You're breaking the rules of how Promises work. While I haven't managed to exactly replicate your error, I can tell you the problem is ...
  • 462k

Only top scored, non community-wiki answers of a minimum length are eligible