Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed Jun 28, 2018
1 parent 78c4ed9 commit 102dbfd
Show file tree
Hide file tree
Showing 3 changed files with 165 additions and 158 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
overflow-y: auto;
display: block;
}
ul .is-selected {
ul .is-focused {
color: blue;
font-weight: bold;
}
Expand Down
11 changes: 6 additions & 5 deletions demo/script.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Suggestions, Source, AjaxSource } from '../src/suggestions.js';
import { Suggestions, AjaxSuggestions } from '../src/suggestions.js';

const datalistInput = document.getElementById('input-datalist');
const source = Source.createFromElement(document.getElementById('colors'));
const ajax = new AjaxSource('data.json', datalistInput.closest('fieldset'));

const suggestions = new Suggestions(datalistInput, source);
const suggestions = Suggestions.createFromElement(document.getElementById('colors'));
//const suggestions = new AjaxSuggestions('data.json', datalistInput.closest('fieldset'));

datalistInput.addEventListener('suggestion:choosen', e => {
suggestions.attachInput(datalistInput);

datalistInput.addEventListener('suggestions:select', e => {
console.log(e.detail);
});

Expand Down
Loading

0 comments on commit 102dbfd

Please sign in to comment.