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(create-grid): include elements scrolled out of view in the grid #3773

Merged
merged 14 commits into from
Nov 14, 2022

Conversation

WilcoFiers
Copy link
Contributor

Closes issue: #3772

lib/commons/dom/create-grid.js Outdated Show resolved Hide resolved
Comment on lines +46 to +47
'<div id="n0" style="position: fixed; top:-31px; height: 60px">0</div>' +
'<div id="n1" style="position: fixed; top:-31px; height: 30px">1</div>' +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found a weird bug around isOffScreen. Something with bottom:0 is considered on screen. Changing that caused a bunch of other problems. Need to look into that, but seems like a separate issue.

@WilcoFiers WilcoFiers marked this pull request as ready for review November 10, 2022 13:55
@WilcoFiers WilcoFiers requested a review from a team as a code owner November 10, 2022 13:55
@WilcoFiers WilcoFiers requested a review from straker November 10, 2022 15:03
Comment on lines 386 to 388
if (debug) {
console.log({ x, y }, { rowIndex, colIndex }, { top, right, bottom, left });
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, will fix

lib/commons/dom/create-grid.js Outdated Show resolved Hide resolved
test/commons/dom/create-grid.js Outdated Show resolved Hide resolved
lib/commons/dom/create-grid.js Outdated Show resolved Hide resolved
lib/commons/math/get-bounding-rect.js Show resolved Hide resolved
test/commons/math/is-point-in-rect.js Outdated Show resolved Hide resolved
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

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

Direction LGTM

straker
straker previously approved these changes Nov 14, 2022
'Element midpoint exceeds the grid bounds'
);
const row = this.cells[rowIndex - this.cells._negativeIndex] ?? [];
return row[colIndex - row._negativeIndex] ?? null;
Copy link
Contributor

Choose a reason for hiding this comment

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

Small thing. Maybe this should return an empty array instead of null? That way when you use it in get-rect-stack we wouldn't need to do default it to an empty array using || [] after the call?

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

Successfully merging this pull request may close these issues.

2 participants