Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private scrollActiveOptionIntoView() {
const activeOptionIndex = this.tree.keyManager.activeItemIndex || 0;
this.panel.nativeElement.scrollTop = getOptionScrollPosition(
activeOptionIndex,
this.getItemHeight(),
this.panel.nativeElement.scrollTop,
SELECT_PANEL_MAX_HEIGHT
);
}
private scrollActiveOptionIntoView(): void {
const activeOptionIndex = this.keyManager.activeItemIndex || 0;
const labelCount = countGroupLabelsBeforeOption(activeOptionIndex, this.options, this.optionGroups);
this.optionsContainer.nativeElement.scrollTop = getOptionScrollPosition(
activeOptionIndex + labelCount,
this.getItemHeight(),
this.optionsContainer.nativeElement.scrollTop,
SELECT_PANEL_MAX_HEIGHT
);
}
private scrollToOption(): void {
const index = this.autocomplete.keyManager.activeItemIndex || 0;
const labelCount = countGroupLabelsBeforeOption(index,
this.autocomplete.options, this.autocomplete.optionGroups);
const newScrollPosition = getOptionScrollPosition(
index + labelCount,
AUTOCOMPLETE_OPTION_HEIGHT,
this.autocomplete.getScrollTop(),
AUTOCOMPLETE_PANEL_HEIGHT
);
this.autocomplete.setScrollTop(newScrollPosition);
}
private scrollActiveOptionIntoView() {
const activeOptionIndex = this.tree.keyManager.activeItemIndex || 0;
this.panel.nativeElement.scrollTop = getOptionScrollPosition(
activeOptionIndex,
this.tree.getItemHeight(),
this.panel.nativeElement.scrollTop,
SELECT_PANEL_MAX_HEIGHT
);
}
private scrollActiveOptionIntoView(): void {
const activeOptionIndex = this.keyManager.activeItemIndex || 0;
const labelCount = countGroupLabelsBeforeOption(activeOptionIndex, this.options, this.optionGroups);
this.panel.nativeElement.scrollTop = getOptionScrollPosition(
activeOptionIndex + labelCount,
this.getItemHeight(),
this.panel.nativeElement.scrollTop,
SELECT_PANEL_MAX_HEIGHT
);
}