6

Is it possible to scroll a specific data row into view when using the angular material mat-table cdk-table?

I'm trying to implement keyboard scrolling with no luck.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
user2587790
  • 121
  • 1
  • 1
  • 8
  • 1
    It's really difficult to understand what you are trying to achieve. Have a look at https://stackoverflow.com/help/how-to-ask – bugs Apr 06 '18 at 17:07
  • 1
    What i want to do is to select the next or prev row in the mat-table by the keyboard. The selection is working as expected. Now i only need to have the selected/current row visible in view. in the stackblitz example you can see it. It's a changed example of a mat-table demo. https://stackblitz.com/edit/mensand-rowselect?file=app%2Ftable-basic-example.html – user2587790 Apr 07 '18 at 19:00
  • You have something that kind of works, that's a starting point. Now, if you provide a stackblitz example of you currently have we might be able to help – bugs Apr 07 '18 at 19:01

1 Answers1

3

I've it working now. Not perfect but it works.

See the example on stack blitz mentioned in my earlier message.

https://stackblitz.com/edit/mensand-rowselect?file=app%2Ftable-basic-example.html

user2587790
  • 121
  • 1
  • 1
  • 8
  • not perfect! this is perfection in a post :D many thanks, although I did tweak your answer slightly to instead use ... @ViewChildren('partRow', {read: ElementRef}) partRows: QueryList; – danday74 Jul 16 '21 at 02:32