Components: Inconsistency in Contents Panel in theming page

Created on 21 Jan 2020  路  4Comments  路  Source: angular/components

Documentation Feedback

Theming your own components is not behaving as other items in the Contents panel. Even clocking on it is higlightinng the previous item in that item list.

Link: https://material.angular.io/guide/theming
theming_error

P3 material.angular.io docs

All 4 comments

Hi,
Greetings!
Could you please check on this inconsistency in documentation.

Thanks

Any updates on the above issue?

any updates?

This is happening since we didn't scroll past the anchor point. The link is not marked as "active".

https://github.com/angular/material.angular.io/blob/master/src/app/shared/table-of-contents/table-of-contents.ts#L142

  private isLinkActive(currentLink: any, nextLink: any): boolean {
    // A link is considered active if the page is scrolled passed the anchor without also
    // being scrolled passed the next link
    const scrollOffset = this.getScrollOffset();
    return scrollOffset >= currentLink.top && !(nextLink && nextLink.top < scrollOffset);
  }
Was this page helpful?
0 / 5 - 0 ratings