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?`);
2919
+
}
2920
+
constrawAction=params.action;
2921
+
constactionArgs=Object.assign({},params);
2922
+
deleteactionArgs.action;
2946
2923
constdirectives=parseDirectives(rawAction);
2947
2924
letdebounce=false;
2948
2925
directives.forEach((directive)=>{
2949
2926
letpendingFiles={};
2950
2927
constvalidModifiers=newMap();
2951
-
validModifiers.set('prevent',()=>{
2952
-
event.preventDefault();
2953
-
});
2954
2928
validModifiers.set('stop',()=>{
2955
2929
event.stopPropagation();
2956
2930
});
@@ -2985,12 +2959,15 @@ class LiveControllerDefault extends Controller {
@@ -3019,11 +2993,13 @@ class LiveControllerDefault extends Controller {
3019
2993
this.component.fingerprint=this.fingerprintValue;
3020
2994
}
3021
2995
getEmitDirectives(event){
3022
-
constelement=event.currentTarget;
3023
-
if(!element.dataset.event){
3024
-
thrownewError(`No data-event attribute found on element: ${getElementAsTagText(element)}`);
2996
+
constparams=event.params;
2997
+
if(!params.event){
2998
+
thrownewError(`No event name provided on element: ${getElementAsTagText(event.currentTarget)}. Did you forget to add the "data-live-event-param" attribute?`);
3025
2999
}
3026
-
consteventInfo=element.dataset.event;
3000
+
consteventInfo=params.event;
3001
+
consteventArgs=Object.assign({},params);
3002
+
deleteeventArgs.event;
3027
3003
constdirectives=parseDirectives(eventInfo);
3028
3004
constemits=[];
3029
3005
directives.forEach((directive)=>{
@@ -3039,7 +3015,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?`);
123
+
thrownewError(
124
+
`No action name provided on element: ${getElementAsTagText(
125
+
event.currentTarget
126
+
)}. Did you forget to add the "data-live-action-param" attribute?`
127
+
);
124
128
}
125
129
constrawAction=params.action;
126
130
// 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?`);
238
+
if(!params.event){
239
+
thrownewError(
240
+
`No event name provided on element: ${getElementAsTagText(
241
+
event.currentTarget
242
+
)}. Did you forget to add the "data-live-event-param" attribute?`
243
+
);
236
244
}
237
245
consteventInfo=params.event;
238
246
// all other params are considered event arguments
0 commit comments