From 1c2ecc3393c9a7103b24ed880008883b92217898 Mon Sep 17 00:00:00 2001 From: Secretmapper Date: Tue, 8 Nov 2016 00:03:56 +0800 Subject: [PATCH] Spread list props to suggestion --- awesomplete.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awesomplete.js b/awesomplete.js index 4a0e7e84..fa890142 100644 --- a/awesomplete.js +++ b/awesomplete.js @@ -304,6 +304,8 @@ function Suggestion(data) { ? { label: data[0], value: data[1] } : typeof data === "object" && "label" in data && "value" in data ? data : { label: data, value: data }; + for (var attr in data) { this[attr] = data[attr]; } + this.label = o.label || o.value; this.value = o.value; }