Commit 5fd2dd5
committed
Merged PR 88804: Removed html element comparison based on id
HTML elements are now compared by their JS object instance **instead of** their id.
Issue with comparing elements by their id: HTML elements with no id attribute will be compared as equal since id is empty string when id attribute's value is not defined.
**How to repro this bug:**
1. Create 2 div elements without id attribute `<div></div> <div/></div>`
2. Get JS reference for them using `let divs = document.querySelectorAll('div');`
Note that, `id` of both div elements is same, i.e. `divs[0].id` is "" (empty string) and `divs[1].id` is also "" (empty string)
3. Embed 2 powerbi entities, E.g.:
```javascript
let report = powerbi.embed(divs[0], reportConfig);
report.on('loaded', () => {console.log('report loaded')});
let dashboard = powerbi.embed(divs[1], dashboardConfig);
dashboard.on('loaded', () => {console.log('dashboard loaded')});
```
4. Check console, only 'dashboard loaded' string should be logged1 parent 9a748a4 commit 5fd2dd5
File tree
5 files changed
+64
-3
lines changed- dist
- src
- test
5 files changed
+64
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1711 | 1711 | | |
1712 | 1712 | | |
1713 | 1713 | | |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
1714 | 1721 | | |
1715 | 1722 | | |
1716 | 1723 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
453 | 453 | | |
454 | 454 | | |
455 | 455 | | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
456 | 463 | | |
457 | 464 | | |
458 | 465 | | |
459 | | - | |
| 466 | + | |
460 | 467 | | |
461 | 468 | | |
462 | 469 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
100 | 140 | | |
101 | 141 | | |
102 | 142 | | |
| |||
0 commit comments