Skip to content

Commit

Permalink
Remove defense check of active item when completer is opened
Browse files Browse the repository at this point in the history
  • Loading branch information
afshin committed May 7, 2023
1 parent 5533fa2 commit af840fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/completer/src/widget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export class Completer extends Widget {
const node = this._createCompleterNode(model, items);

let active = node.querySelectorAll(`.${ITEM_CLASS}`)[this._activeIndex];
active?.classList.add(ACTIVE_CLASS);
active.classList.add(ACTIVE_CLASS);

// Add the documentation panel
if (this._showDoc) {
Expand Down Expand Up @@ -546,7 +546,7 @@ export class Completer extends Widget {
}

active = items[this._activeIndex] as HTMLElement;
active?.classList.add(ACTIVE_CLASS);
active.classList.add(ACTIVE_CLASS);
let completionList = this.node.querySelector(`.${LIST_CLASS}`) as Element;
ElementExt.scrollIntoViewIfNeeded(completionList, active);
this._indexChanged.emit(this._activeIndex);
Expand Down

0 comments on commit af840fd

Please sign in to comment.