Skip to content

Commit

Permalink
Completer: Fix null data being emitted when triggering instrumented e…
Browse files Browse the repository at this point in the history
…vents
  • Loading branch information
yhabteab committed May 5, 2022
1 parent f4080ec commit a330e8c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions asset/js/widget/Completer.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ define(["../notjQuery"], function ($) {
}, 200);
}

suggest(input, value, data = null) {
suggest(input, value, data = {}) {
if (this.instrumented) {
if (data === null) {
if (! Object.keys(data).length) {
data = value;
}

Expand All @@ -256,6 +256,10 @@ define(["../notjQuery"], function ($) {
$(input).focus({ scripted: true });

if (this.instrumented) {
if (! Object.keys(data).length) {
data = value;
}

$(input).trigger('completion', data);
} else {
input.value = value;
Expand Down

0 comments on commit a330e8c

Please sign in to comment.