Skip to content

fix(all dispatchevent on components): make event propageable to work… #399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/datepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ export class Datepicker extends Component<DatepickerOptions> {
*/
setInputValue() {
this.el.value = this.toString();
this.el.dispatchEvent(new CustomEvent('change', {detail: {firedBy: this}}));
this.el.dispatchEvent(new CustomEvent('change', {bubbles:true, cancelable:true, composed:true, detail: {firedBy: this}}));
}

_renderDateDisplay() {
Expand Down
2 changes: 1 addition & 1 deletion src/forms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export class Forms {
filenames.push(files[i].name);
}
pathInput.value = filenames.join(', ');
pathInput.dispatchEvent(new Event('change'));
pathInput.dispatchEvent(new Event('change',{bubbles:true, cancelable:true, composed:true}));
});
});

Expand Down
2 changes: 1 addition & 1 deletion src/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ export class FormSelect extends Component<FormSelectOptions> {
previousSelectedValues,
actualSelectedValues
);
if (selectionHasChanged) this.el.dispatchEvent(new Event('change')); // trigger('change');
if (selectionHasChanged) this.el.dispatchEvent(new Event('change',{bubbles:true, cancelable:true, composed:true})); // trigger('change');
}
if (!this.isMultiple) this.dropdown.close();
}
Expand Down
2 changes: 1 addition & 1 deletion src/timepicker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ export class Timepicker extends Component<TimepickerOptions> {
this.el.value = value;
// Trigger change event
if (value !== last) {
this.el.dispatchEvent(new Event('change'));
this.el.dispatchEvent(new Event('change',{bubbles:true, cancelable:true, composed:true}));
}
this.close();
this.el.focus();
Expand Down