Skip to content

Commit 38dd8f0

Browse files
authored
Add change events (#32379)
1 parent 6e46df9 commit 38dd8f0

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

build/media_source/system/js/fields/joomla-field-media.w-c.es6.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@
152152
setValue(value) {
153153
this.inputElement.value = value;
154154
this.updatePreview();
155+
156+
this.dispatchEvent(new CustomEvent('change', {
157+
detail: { value },
158+
bubbles: true,
159+
}));
155160
}
156161

157162
clearValue() {

build/media_source/system/js/fields/joomla-field-simple-color.w-c.es6.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,11 @@
365365
this.icon.setAttribute('class', clss);
366366
this.icon.style.backgroundColor = bgcolor;
367367

368+
this.dispatchEvent(new CustomEvent('change', {
369+
detail: { value: color },
370+
bubbles: true,
371+
}));
372+
368373
// Hide the panel
369374
this.hide();
370375

build/media_source/system/js/fields/joomla-field-user.w-c.es6.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,10 @@
140140
this.input.setAttribute('value', value);
141141
this.inputName.setAttribute('value', name || value);
142142
// trigger change event
143-
this.input.dispatchEvent(new Event('change'));
143+
this.dispatchEvent(new CustomEvent('change', {
144+
detail: { value, name },
145+
bubbles: true,
146+
}));
144147
}
145148
}
146149

0 commit comments

Comments
 (0)