rexrainbow / phaser3-rex-notes

Notes of phaser3 engine
MIT License
1.2k stars 260 forks source link

GridTable layout incorrect when using horizontal scrollMode #347

Closed 0xShortCircuit closed 1 year ago

0xShortCircuit commented 1 year ago

We've been using GridTables with scrollMode set to horizontal (1) to display lists of items in our app for some time now without issues, however it seems there was a recent update that has caused the gridTable layout to be incorrect only when using horizontal scrollMode.

Since then, the first item in the list is hidden from view as the table lays out wider than it's specified width, although the 'window' to view the table is the correct width. This leaves the left end of the table underneath to be unviewable. We can see the first item is there when we use drawBounds(), or when we drag and hold long enough to see it. What's also interesting is the table lays out too far to the left by the same amount of one cell's width, so it doesn't even look like there's a problem until you realize the first list item isn't the first item you see.

I included screenshots of a modal window containing a gridTable with scrollMode set to 0, then another when it is set to 1, with drawBounds() called. The table width is set to the same width as the modal window.

We are now seeing this issue on all of our gridTables that use horizontal scrollMode. The issue seem to have been introduced 1-2 weeks ago, but could have been a bit longer and we just didn't notice right away.

GridTable_ScrollMode_0 GridTable_ScrollMode_1

rexrainbow commented 1 year ago

Thanks for reporting this bug. I tried to fix it at last commit, please get last version of minify file and test it with your case. NPM package will be upgraded at end of this month.

rexrainbow commented 1 year ago

NPM package has been upgraded.

0xShortCircuit commented 1 year ago

Latest NPM package fixed this issue for us. Thank you!