adopted-ember-addons / adopted-ember-addons/ember-light-table
querySelector errors when resizing columns in 2.x
- 主要語言
- JavaScript
- 星號
- 311
- 分支
- 130
- PR 合併指標
- 30 天內沒有已合併 PR
描述
Using `ember-light-table` version `2.0.0-beta.4` and Ember 3.9, I am seeing these thrown when using the resize handles to alter a column's width, which breaks any following attempts to resize the same column:
```
TypeError: table.querySelector(...) is null [lt-column-resizer.js:89]
TypeError: null has no properties [lt-column-resizer.js:89]
```
It appears that the selectors here in [/addon/components/lt-column-resizer.js](https://github.com/offirgolan/ember-light-table/blob/2-x/addon/components/lt-column-resizer.js#L94) are not finding a matching element and thus triggering the error -- compare to [pre-2.x](https://github.com/offirgolan/ember-light-table/blob/master/addon/components/lt-column-resizer.js#L93) which used jQuery instead of querySelector, which IIRC will not error out if the selector fails. I'd guess this difference is most likely causing this issue.
Also to note, I attempted to work around this by turning on `enableScaffolding` in the table body, but it seems to still not generate the scaffolding cells -- poking around the templates, it seems these might only generate in the header when using sub-columns (I'm providing a flat column array).
貢獻指南
研究方向
Start by reproducing repeated column resizing with Ember 3.9 and inspect addon/components/lt-column-resizer.js around line 89 (or line 94 in the linked 2.x source). Compare its querySelector usage with the pre-2.x implementation, then inspect the table-body templates and enableScaffolding behavior for flat columns. Done means resizing a column repeatedly no longer throws and the reported scaffolding behavior is understood or corrected.
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript
- 領域
- frontend
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 基本清楚
- 新手友好度
- 39/100