This commit is contained in:
Vanessa 2022-06-08 10:41:06 +08:00
parent 5981e78116
commit 1f834bc041

View file

@ -226,8 +226,8 @@ export class Outline extends Model {
}
if (currentElement) {
currentElement.classList.add("b3-list-item--focus");
const currentRect = currentElement.getBoundingClientRect()
const scrollRect = this.element.getBoundingClientRect()
const currentRect = currentElement.getBoundingClientRect();
const scrollRect = this.element.getBoundingClientRect();
if (currentRect.top < scrollRect.top) {
currentElement.scrollIntoView();
} else if (currentRect.bottom > scrollRect.bottom) {