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
+42-28Lines changed: 42 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -963,7 +963,7 @@ function setDeepData(data, propertyPath, value) {
963
963
constfinalKey=parts[parts.length-1];
964
964
if(typeofcurrentLevelData!=='object'){
965
965
constlastPart=parts.pop();
966
-
thrownewError(`Cannot set data-model="${propertyPath}". They parent "${parts.join(',')}" data does not appear to be an object (it's "${currentLevelData}"). Did you forget to add exposed={"${lastPart}"} to its LiveProp?`);
966
+
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?`);
967
967
}
968
968
if(currentLevelData[finalKey]===undefined){
969
969
constlastPart=parts.pop();
@@ -1014,6 +1014,26 @@ function haveRenderedValuesChanged(originalDataJson, currentDataJson, newDataJso
@@ -1112,23 +1132,12 @@ class default_1 extends Controller {
1112
1132
this._makeRequest(null);
1113
1133
}
1114
1134
_getValueFromElement(element){
1115
-
constvalue=element.dataset.value||element.value;
1116
-
if(!value){
1117
-
constclonedElement=(element.cloneNode());
1118
-
if(!(clonedElementinstanceofHTMLElement)){
1119
-
thrownewError('cloneNode() produced incorrect type');
1120
-
}
1121
-
thrownewError(`The update() method could not be called for "${clonedElement.outerHTML}": the element must either have a "data-value" or "value" attribute set.`);
thrownewError('cloneNode() produced incorrect type');
1131
-
}
1140
+
constclonedElement=cloneHTMLElement(element);
1132
1141
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