Skip to content

Commit

Permalink
add div.suggestions-wrapper to wrap ul.suggestions (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
katydecorah authored Mar 21, 2019
1 parent 6cbf65b commit 4fe487a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ var List = function(component) {
this.component = component;
this.items = [];
this.active = 0;
this.wrapper = document.createElement('div');
this.wrapper.className = 'suggestions-wrapper';
this.element = document.createElement('ul');
this.element.className = 'suggestions';
this.wrapper.appendChild(this.element);

// selectingListItem is set to true in the time between the mousedown and mouseup when clicking an item in the list
// mousedown on a list item will cause the input to blur which normally hides the list, so this flag is used to keep
// the list open until the mouseup
this.selectingListItem = false;

component.el.parentNode.insertBefore(this.element, component.el.nextSibling);
component.el.parentNode.insertBefore(this.wrapper, component.el.nextSibling);
return this;
};

Expand Down

0 comments on commit 4fe487a

Please sign in to comment.