Questions tagged [locker-service]
Locker Service is a set of new security features for Lightning Components.
95
questions
18
votes
1answer
6k views
Which external Javascript libraries work with Lightning Locker Service?
Components often seem to work with external libraries until the Locker Service is enabled. What libraries work with locker service enabled and where can I go to find out?
6
votes
0answers
373 views
Unable to add custom scroll due to “component/namespace encapsulation” when Locker Service is active
I'm unable to add custom scroll due to the component/namespace encapsulation when locker service is activated in Salesforce1 app. Since the Scrollable is still not compatible with Salesforce1 app, and ...
4
votes
1answer
1k views
Locker Service for Communities blocks any attempts to include Salesforce Live Agent. Is this a bug?
I am leaning on my friends at Salesforce Stack for a very important
question that I have spent a great deal of time on over the past few
weeks. Warning: This is a long one, please grab yourself a ...
4
votes
1answer
1k views
Is there any way to validate a third party JavaScript library against Lightning LockerService?
I have been using some of the third party libraries e.g. pdf.js and html2canvas.js for a customer project. Now when I activate the LockerService, these libraries do not work as expected. Is there any ...
6
votes
2answers
2k views
Why won't my Lightning Component Attributes store entered value
2/15/2017 Update
Per comment from Doug in one of the answers this is an issue with Locker service. I verified that with Locker disabled is works as expected...
In Spring 17 as of today, with locker ...
14
votes
1answer
2k views
Lightning component scripts loading issues since Spring 17 update
Since last update (7th of January), I am not able to load correctly those scripts:
Quilljs
trix
<ltng:require
scripts="{! join(',', $Resource.lodash, $Resource.trix, $Resource.quill )}"
...
8
votes
1answer
1k views
Workaround for application event duplicates in cached lightning components (IN LOCKERSERVICE)?
This link should provide a lot of background information for my issue.
Basically the problem is with Application Events, and cached lightning components.
If your lightning component lives inside a ...
12
votes
1answer
1k views
Lightning Locker Service and object fields at different levels
I'm seeing some unexpected behaviour with the locker service enabled when updating two fields on an object, one of which is nested inside a sub-object.
I have a lightning application that ...
12
votes
4answers
4k views
How do we identify which lightning input is updated in an iteration?
I'm trying to construct a page that allows users to edit records, and it should be in SLDS, so I'm trying to use lightning:input to minimize the amount of code I need to write. Ultimately, a method ...
3
votes
0answers
2k views
Binding to object values and arrays of objects in Lightning Locker
This is related to: Lightning Locker Service and object fields at different levels
But I thought it best to just give my example here rather than pollute someone else's thread.
I am seeing a similar ...
9
votes
4answers
3k views
(MS Edge) Error when accessing window.location in lightning components with LockerService enabled
My lightning component (V40/SU17) errors out when accessed via MS Edge with LockerService enabled. Is there a different method of accessing the window.location?
WindowLocation.cmp
<aura:component ...
3
votes
1answer
2k views
Can't set element.style.properties in JS inside Lightning Locker
Minimal example under Lightning Locker:
StyleTest.app:
<aura:application >
<p id="special">Look at me! I am so very special!</p>
<ui:button label="Element.style.color = '...
21
votes
2answers
5k views
Avoid Proxy objects in debug statements for a Lightning component
This may be a very basic questions, but I don't seem to find the answer for it! Basically I want my console.log statements to show all the good stuff instead of the LockerService Proxy object. Is ...
10
votes
2answers
4k views
Locker Service document.cookie support
We have a packaged lightning component for use in communities that uses a cookie to track some properties about unauthenticated users between page visits. In my DE org, Locker Service has no support ...
4
votes
1answer
908 views
LockerService not allowing subscribing to $A.logger
I have made a test Lightning app to figure out why error catching isn't working as I expected.
Component:
<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
</aura:...
4
votes
4answers
1k views
Unable to access HTML ātargetā attribute with locker service
I am facing an issue with the Locker Service. I have a simple piece of code. I have attached the code here. The issue is that if the Locker Service is disabled, I am able to open a link in new tab ...
3
votes
1answer
636 views
Promise and access to access=private attributes
I am trying to use Promise to make my code more readable and efficient but I'm stuck with the inability to get/set private attribute values.
Consider the following example:
<aura:component>
...
9
votes
3answers
3k views
Window access on secure DOM (LockerService)
I am trying to change my application to match the LockerService requirements and one of the issues I've ran into are using listeners that need access to the window object. I need to resize my ...
6
votes
1answer
5k views
Lightning Component - Locker Service: Onclick button, div no longer working
With locker service activated I'm seeing following error occurring in my components:
HTML event such as onclick no longer provides target information for a div or a button element.
For example:
I ...
6
votes
2answers
1k views
Locker Service: How to get the event target?
Greetings great people of the Salesforce Stackexchange,
We are having some trouble with Salesforce Locker Service update in the custom Lightning Components we're developing.
This works without ...
5
votes
1answer
998 views
Onclick not working in lightning components in Edge
We have a community built with custom lightning components and the locker service update is active. The onclick event has been defined on several components. The onclicks are working fine in Chrome, ...
5
votes
3answers
311 views
Locker-Service safe passing of data from <a> and <lightning:xyz> to controller
In my lightning component I loop over records and display links to them:
1) Works, but is discouraged as it doesn't work in all places
<aura:iteration items="{!v.records}" var="record">
&...
3
votes
0answers
851 views
Dynamic rendering of D3 charts - D3.js selectAll function is not working when Lightning Locker is enabled
In our application, we are using D3.js to dynamically altering SVG components using the code as below.
linkContainer.selectAll("line").remove();
var link = self.drawLinks(...
2
votes
1answer
1k views
In Chart.js mouse hover is not working Locker Service Enabled Org
On mouse hover I am encounter one error in lightning component. But in JS fiddle it is working fine.
afterChartJsLoaded: function(component, event, helper) {
var el = component.find("chart")....
6
votes
1answer
584 views
Security Review: Illegal DOM Access in Lightning Component
I submitted a lightning component to the Security Review. They reported an issue regarding Illegal DOM Access.
I used the following code in my helper and security review team reported it has an issue....
5
votes
5answers
3k views
ui:inputDate change event not firing
How do you add a change listener on an input date component that has been changed via the date picker?
Here's my current approach that does not work:
.app file
<aura:application >
<ui:...
3
votes
2answers
2k views
Lockerservice and event.getSource()
I have a few lightning components already written and those use <lightning:x /> markup.
I am still not able to use event.getSource() instead of an aura:id in scenario where I do an aura:...
3
votes
1answer
198 views
Lightning Bundle fails to use external libraries after LockerService is Enabled
I am developing a component, that shows a set of photos, in a simple div, and then, by clicking one of them opens up gallery popup. I have successfully imported my external Javascript libraries as ...
2
votes
1answer
2k views
Cross-Origin Frame Error in Lightning Component embedded in Salesforce Console
Prior to the Summer 17 release, my lightning component worked fine. After the release, I changed my API version for my VF page and lightning components to v40.
Now when I try to load jQuery, I ...
2
votes
1answer
788 views
LockerService in Lightning Components is blocking Canvas element color fill completely
When LockerService is activated, it makes <canvas> element unusable.
And if I deactivate LockerService, it would display <canvas> in filled color.
Consider following code and actual result ...
1
vote
1answer
158 views
VF pages supported in Community Builder - What happens with the 3rd party JS libraries? Any LockerService Implication?
I was playing with a page that I am trying to put on to work for the community builder. The page uses the lightgallery library, to open up a popup gallery for some photos.
I verified that now the ...
1
vote
1answer
972 views
None of the JS external library work with locker services Salesforce lightning enabled
For my client, I am using Chart.Js and d3. After I have moved my code to new org which has locker service enabled. None of my components work. All the object defined in the JS are throwing undefined ...
0
votes
2answers
11k views
document.getElementById(“something”).value not working for <Select> with <option> not working after Locker Service enabled
The document.getElementById("something").value in my controller on HTML tag with is not working after Locker Service is enabled. I did console.log() and it's returning nothing.
Any idea how to ...
28
votes
2answers
655 views
API v40 slows down Apex generated data in Lightning Components
Given a super simple scenario loading a list of 2000 Strings via Apex controller. When I process the list in a Lightning Component, there is a huge difference in performance between API v39 and v40. ...
7
votes
1answer
780 views
Is it possible to mass-save many lightning:recordEditForms with only ONE button?
Im implementing an line item editor for the "Order" SObject and want give lightning:recordEditForm with lightning:inputField a try for this.
What I have so far is an edit for the order combined with ...
13
votes
1answer
2k views
component.find({ instancesOf : ālightning:inputā}) return empty list in Summer '18
With new Summer '18 release following code returns empty list:
component.find("social-security-number-form").find({instancesOf : "lightning:input"})
"social-security-number-form" is an aura:id of ...
4
votes
2answers
3k views
Data binding for different attribute types in parent & child components under locker service
With a lack of documentation I'm trying to understand how data binding works under locker service, when using different types in <aura:attribute type="..."> to pass values between parent & ...
17
votes
2answers
562 views
Locker Service: Cannot set field values that were null on records from SOQL or SObjectType.newSObject()
We have a number of Apex controllers that are shared between Visualforce and Lightning. When these controllers init record values, there are some cases where no record value exists, so the method uses ...
11
votes
3answers
1k views
Lightning support for eval() in Summer 18
I thought that eval() was supported in Lightning in Summer 18. According to the release notes, it is:
The eval() function is now available in Locker Service, even when
Strict CSP is enabled. This ...
9
votes
1answer
1k views
How to access the FileList array for file inputs in Lightning Components with LockerService
I have been experimenting with LockerService and found that the files array that should be available in JavaScript for file input types is not available when LockerService is enabled.
Component ...
7
votes
2answers
1k views
DOM manipulation using External libraries in lightning component
As per the LC documentation and answers to the below questions:
1.Jquery selector is not working properly in subsequent loads in lightning component.
2.DOM modification feasibility in lightning.
It'...
6
votes
1answer
2k views
Locker service and lightning web components
Is there any documentation yet on how locker service fits in with lightning web components? If yes,
What are the implications of locker service on lightning web components?
What are locker service ...
5
votes
2answers
2k views
Uncaught TypeError: Cannot redefine property: title throws at …/aura_prod.js (Lightning Locker)
Lightning Locker seems to be causing major issues with the jQuery selector and find actions (and by extension most other jQuery functions). Certain errors were arising due to jQuery 2.1.4 that are ...
10
votes
2answers
2k views
Scheduler Javascript Library / Component that works in Salesforce Lightning with LockerService
Please, could someone recommend a Scheduler Javascript Library / Component which will works in Salesforce Lightning with LockerService?
Something like this:
7
votes
1answer
2k views
Issue with lightning locker service and jQuery static resource
I get the following error when attempting to use a lightning component (previously working with Spring 16) in a Summer 16 pre-release org, presumably because of the new locker service:
"Uncaught ...
6
votes
1answer
794 views
jQueryUi input[inputIndex].hasOwnProperty is not a function
I'm trying to use jQueryUi V1.11.4 is a Salesforce Summer 17' Sandbox and I get this error :
Uncaught TypeError: input[inputIndex].hasOwnProperty is not a function
throws at /resource/1498467744000/...
6
votes
2answers
2k views
How can we use custom SVG icons in Lightning Component with LockerService enabled?
I'm trying to use a custom SVG icon in a Lightning Component (not part of SLDS pre defined icons). I've put the SVG icon in following manner:
MyTestApp.cmp
<aura:component >
<div aura:...
6
votes
3answers
4k views
component.get(v.body) not working as expected
As per the doc:
The root-level tag of every component is aura:component. Every
component inherits the body attribute from <aura:component>.
The body attribute has type Aura.Component[]. ...
6
votes
2answers
920 views
Locker Service and Fullcalendar.io
I have seen that there have already been some questions regarding the open source Fullcalendar.io and the various libraries associated with it, and the strict requirements of Locker Service, but I was ...
2
votes
3answers
2k views
Locker Service - Uncaught TypeError: Cannot read property 'expando' of undefined
Uncaught TypeError: Cannot redefine property: title
throws at https://final-bugfix1-dev-ed.lightning.force.com/auraFW/javascript/dpJ3LUIaUXt-CtvrXqBcnQ/aura_prod.js:459:356
I have enabled Locker ...