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

Fix resizing column logic #41

Merged
merged 2 commits into from
Oct 21, 2022
Merged

Fix resizing column logic #41

merged 2 commits into from
Oct 21, 2022

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Oct 20, 2022

Requires #12
(will make the diff actually understandable)

Will be made simpler by: #40
(but that's not required by this work, and can lead to a nice delete a bunch of things PR later

@github-actions
Copy link
Contributor

github-actions bot commented Oct 20, 2022

@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review October 21, 2022 19:57
@NullVoxPopuli NullVoxPopuli force-pushed the fix-resizing-column-logic branch from 0288cdd to bd66b7a Compare October 21, 2022 22:13
/**
* There can be nothing after the last column
*/
if (referenceIndex > visible.length - 1) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this need to be:

Suggested change
if (referenceIndex > visible.length - 1) {
if (referenceIndex >= visible.length - 1) {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if there are 5 columns
and reference index is 4 (max), there is no next column -- due to 4 > 5 - 1 being falsey... we hit line 198, and accidentally get a falsey value, which is correct anyway

hm. this is copy and paste from the other implementation, but I'm going to fix this over in: #40
(and then delete this and the original implementation).

I do not like accidentally working. thanks for catching this!

import * as QUnit from 'qunit';
import { module, test, skip } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setOwner } from '@ember/application';
// @ts-ignore
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the ts-ignore here?

Copy link
Contributor Author

@NullVoxPopuli NullVoxPopuli Oct 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typed ember team hasn't added types for these yet :(
(and I haven't felt like PRing yet)

It'll be a non problem once TS 4.8 (or whatever officially has types) is the minimum supported version

@NullVoxPopuli NullVoxPopuli merged commit 6128708 into main Oct 21, 2022
@NullVoxPopuli NullVoxPopuli deleted the fix-resizing-column-logic branch October 21, 2022 22:43
@github-actions
Copy link
Contributor

github-actions bot commented Nov 2, 2022

🎉 This PR is included in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

3 participants