Using a PrimeNg datatable to display rows of data. I have a p-menu in my first column.
When activated, the p-menu is appended to the body of the page. This works fine for sighted users, however that same menu is only in the tab order at the end of the document, so it might as well be invisible to keyboard users.
<p-column header="" [sortable]="false" [style]="{'width':'2rem'}" >
<ng-template let-col let-files="rowData" pTemplate="body">
<span>
<button type="button" pButton icon="fa fa-chevron-down" class="myClass" (click)="menu.toggle($event);onRowClick( files )" tabindex="0" aria-label="View the Menu" aria-haspopup="true"></button>
<p-menu #menu popup="true" [model]="myModel" styleClass="myclass" appendTo="body"></p-menu>
</span>
</ng-template>
</p-column>
Would be great to do this inside the template... Thoughts?