Skip to content

Commit

Permalink
[PLAY-735] Fixing Table kit undefined mobile headers (#2536)
Browse files Browse the repository at this point in the history
**What does this PR do?**
[Runway
Ticket](https://nitro.powerhrg.com/runway/backlog_items/PLAY-735)

**Screenshots:**

![image](https://user-images.githubusercontent.com/2573205/236353484-e231193e-1538-4f20-a264-8cf2a2b41ebd.png)

**How to test?**
[Here is the CodeSandbox](https://codesandbox.io/s/table-forked-jnv05c)
using the alpha version with the fix.

#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [ ] **TESTS** I have added test coverage to my code.
  • Loading branch information
carloslimasd committed May 9, 2023
1 parent 3bc6fbd commit 912a5b1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions playbook/app/pb_kits/playbook/pb_table/index.ts
Expand Up @@ -11,8 +11,12 @@ export default class PbTable extends PbEnhancedElement {
// Each Table
[].forEach.call(tables, (table: HTMLTableElement) => {
// Header Titles
var headers = [].map.call(table.querySelectorAll('th'), (header: Element) => {
return header.textContent.replace(/\r?\n|\r/, '')
let headers: string[] = [];
[].forEach.call(table.querySelectorAll('th'), (header: HTMLTableCellElement) => {
let colSpan = header.colSpan
for (let i = 0; i < colSpan; i++) {
headers.push(header.textContent.replace(/\r?\n|\r/, ''));
}
});

// for each row in tbody
Expand Down

0 comments on commit 912a5b1

Please sign in to comment.