Skip to content

Commit

Permalink
Fixed josdejong#850: make autocomplete options robust against non-str…
Browse files Browse the repository at this point in the history
…ing inputs
  • Loading branch information
josdejong committed Dec 1, 2019
1 parent eb9fb32 commit 0d4525d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
https://github.com/josdejong/jsoneditor


## not yet published, version 7.3.2

- Fixed #850: make autocomplete options robust against non-string inputs
like `null`, `123`, `true`, `false`.


## 2019-12-01, version 7.3.1

- Fixed #855: `onFocus` and `onBlur` not working in modes `text` and `code`
Expand Down
2 changes: 1 addition & 1 deletion examples/11_autocomplete_basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
const options = {
autocomplete: {
getOptions: function () {
return ['apple', 'cranberry', 'raspberry', 'pie', 'mango', 'mandarine', 'melon', 'appleton'];
return ['apple', 'cranberry', 'raspberry', 'pie', 'mango', 'mandarine', 'melon', 'appleton', null, "nothing", false, true, 1234, 123];
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export function autocomplete (config) {

dropDown.style.marginLeft = '0'
dropDown.style.marginTop = element.getBoundingClientRect().height + 'px'
this.options = options
this.options = options.map(String)

if (this.element !== element) {
this.element = element
Expand Down

0 comments on commit 0d4525d

Please sign in to comment.