https://stackblitz.com/github/IgniteUI/igniteui-live-editing-samples/tree/master/angular-demos/data-display/text-highlight-1?file=src%2Fapp%2Ftext-highlight-sample-1%2Ftext-highlight-sample-1.component.html
this works fine but if text is large then the next button does not set focus to below text found user has to scroll down manually which is not the best idea.
// ... const el = document.getElementsByClassName(this.activeHighlightClass); // Scroll to active element after DOM is updated: requestAnimationFrame(() => { this.scrollIntoViewIfNeeded(el[0]); }); // ... public scrollIntoViewIfNeeded(target) { if (target?.getBoundingClientRect().bottom > window.innerHeight) { target.scrollIntoView(false); } if (target?.getBoundingClientRect().top < 0) { target.scrollIntoView(); } }
Thank you so much for the effort and time @Teodosia Hristodorova.
This code works really well for me , just a small question, will it also work if i have search n content in dialog box? and I tried to use this library in my angular 6 application and I am getting a lot of errors while running build, is it not compatible for angular 6?