You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/LiveComponent/assets/dist/live_controller.js
+32-18Lines changed: 32 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -898,7 +898,7 @@ function combineSpacedArray(parts) {
898
898
returnfinalParts;
899
899
}
900
900
901
-
functiongetDeepData(data,propertyPath){
901
+
functionparseDeepData(data,propertyPath){
902
902
constfinalData=JSON.parse(JSON.stringify(data));
903
903
letcurrentLevelData=finalData;
904
904
constparts=propertyPath.split('.');
@@ -914,7 +914,7 @@ function getDeepData(data, propertyPath) {
914
914
};
915
915
}
916
916
functionsetDeepData(data,propertyPath,value){
917
-
const{ currentLevelData, finalData, finalKey, parts }=getDeepData(data,propertyPath);
917
+
const{ currentLevelData, finalData, finalKey, parts }=parseDeepData(data,propertyPath);
918
918
if(typeofcurrentLevelData!=='object'){
919
919
constlastPart=parts.pop();
920
920
thrownewError(`Cannot set data-model="${propertyPath}". The parent "${parts.join('.')}" data does not appear to be an object (it's "${currentLevelData}"). Did you forget to add exposed={"${lastPart}"} to its LiveProp?`);
@@ -990,6 +990,29 @@ function cloneHTMLElement(element) {
@@ -1094,24 +1117,15 @@ class default_1 extends Controller {
1094
1117
constclonedElement=cloneHTMLElement(element);
1095
1118
thrownewError(`The update() method could not be called for "${clonedElement.outerHTML}": the element must either have a "data-model" or "name" attribute set to the model name.`);
0 commit comments