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
thrownewError(`No action name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-action-param" attribute?`);
2868
+
}
2869
+
constrawAction=params.action;
2870
+
constactionArgs=Object.assign({},params);
2871
+
deleteactionArgs.action;
2895
2872
constdirectives=parseDirectives(rawAction);
2896
2873
letdebounce=false;
2897
2874
directives.forEach((directive)=>{
2898
2875
letpendingFiles={};
2899
2876
constvalidModifiers=newMap();
2900
-
validModifiers.set('prevent',()=>{
2901
-
event.preventDefault();
2902
-
});
2903
2877
validModifiers.set('stop',()=>{
2904
2878
event.stopPropagation();
2905
2879
});
@@ -2934,7 +2908,7 @@ class LiveControllerDefault extends Controller {
@@ -2959,11 +2933,13 @@ class LiveControllerDefault extends Controller {
2959
2933
});
2960
2934
}
2961
2935
getEmitDirectives(event){
2962
-
constelement=event.currentTarget;
2963
-
if(!element.dataset.event){
2964
-
thrownewError(`No data-event attribute found on element: ${getElementAsTagText(element)}`);
2936
+
constparams=event.params;
2937
+
if(!params.event){
2938
+
thrownewError(`No event name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-event-param" attribute?`);
2965
2939
}
2966
-
consteventInfo=element.dataset.event;
2940
+
consteventInfo=params.event;
2941
+
consteventArgs=Object.assign({},params);
2942
+
deleteeventArgs.event;
2967
2943
constdirectives=parseDirectives(eventInfo);
2968
2944
constemits=[];
2969
2945
directives.forEach((directive)=>{
@@ -2979,7 +2955,7 @@ class LiveControllerDefault extends Controller {
thrownewError(`No action name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-action-param" attribute?`);
159
+
thrownewError(
160
+
`No action name provided on element: ${getElementAsTagText(
161
+
event.currentTarget
162
+
)}. Did you forget to add the "data-live-action-param" attribute?`
163
+
);
160
164
}
161
165
constrawAction=params.action;
162
166
// all other params are considered action arguments
thrownewError(`No event name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-event-param" attribute?`);
254
+
if(!params.event){
255
+
thrownewError(
256
+
`No event name provided on element: ${getElementAsTagText(
257
+
event.currentTarget
258
+
)}. Did you forget to add the "data-live-event-param" attribute?`
259
+
);
252
260
}
253
261
consteventInfo=params.event;
254
262
// all other params are considered event arguments
0 commit comments