Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

querySelector errors when resizing columns in 2.x #719

Open
cwsault opened this issue Aug 22, 2019 · 4 comments
Open

querySelector errors when resizing columns in 2.x #719

cwsault opened this issue Aug 22, 2019 · 4 comments

Comments

@cwsault
Copy link

cwsault commented Aug 22, 2019

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 are not finding a matching element and thus triggering the error -- compare to pre-2.x 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).

@cwsault cwsault changed the title querySelector errors when resizing columns in 2. querySelector errors when resizing columns in 2.x Aug 22, 2019
@fran-worley
Copy link
Contributor

@cwsault Thanks for reporting I'll try and look into this soon and hopefully ship a fix with beta5

@cwsault
Copy link
Author

cwsault commented Aug 23, 2019

@fran-worley FWIW, I think there may exist a deeper-running issue with resizing at the moment as well -- I tried adding in null checks locally (and also just adding some cells matching the selector to an extra table header/footer...), and while it does fix the errors, the header will only resize once (meaning until the mouse is released -- it expand and shrink freely until then).

Once released, future attempts to resize the same column only resize the main table cells, while the header cell remains the same size. It seems to be that during resizing, the width property of the table cell is altered, but on mouse release this value is assigned to style="width: n" and not altered by future resizings. Not actually sure where the style value is being set though; it still gets set even when I remove the lines I linked

@TomaszWegrzyn
Copy link
Contributor

I found few issues with the resizing(2.x), including:

  • query selector error(as mentioned)
  • header cells not moving while footer cells are being resized
  • the header resizing only once(GJ @cwsault on extensive description)

...I believe I already fixed all of those. I hope I will be able to make a PR tomorrow once I test everything.

@TomaszWegrzyn
Copy link
Contributor

@offirgolan @fran-worley Could you take a look at the fix I provided? We need this issue to be fixed, would be great to know when can we expect new version :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants