TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

March 29, 2024, 09:06:22 AM

Login with username, password and session length
Members
Stats
  • Total Posts: 195,106
  • Total Topics: 21,213
  • Online today: 358
  • Online ever: 3,540 (September 03, 2022, 01:38:54 AM)
Users Online
  • Users: 0
  • Guests: 92
  • Total: 92

"Missing" Block in Panel

Started by Anmer, April 02, 2021, 04:06:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Anmer

I'm running SMF 2.0.17 and TP 2.0.0.

I've set the Top Panel to display blocks in the second grid option:

1 2 3
   4 5

The blocks appeared correctly before I deleted a block and replaced it.  Now the blocks display as:

1 2 3
      4
5

If I delete all the blocks and start again, the same display pattern.  It's as if TP remembers there was once a block in the old position 4 and I can't get another block to appear there.  And the new block 4 is slightly narrower than the one above, see attached.

Any suggestions please?

lurkalot

Hi Anmer.  What code do you have in the block?  Have you tried turning that one off and creating another one to see how that positions itself, I mean just a simple bbc type block with a bit of text it it for testing purposes only.

lurkalot

Ok, confirmed, looks like you found a bug.  This is also present in TP2.0.1

Just wondering and as a workaround, would you be able to get away with using the setting "Display the blocks in 3 columns" instead? Depends what you need to put in block one I suppose.

Anmer

Thanks for getting back to me.

The blocks are HTML/Javascript but the same thing happens if I change to BB Code.

For my purpose, I really wanted to use the grid option.  The other options don't really work for me in this instance.

If it's a bug, so be it.  I'll have to think of a different solution.

Thanks again for your help.  Much appreciated.

@rjen

I am pretty sure this is not working quite right for many versions before... I think this grid function may need to be rewritten to use proper flex grid...
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

Quote from: @rjen on April 02, 2021, 08:58:06 PM
I am pretty sure this is not working quite right for many versions before... I think this grid function may need to be rewritten to use proper flex grid...

I think you're right @rjen, haven't used this feature for some time, in fact can't remember the last time I did. I obviously didn't test it recently either.

I tried the first grid setting too and this seems to work, though it repeats the layout after 4 blocks and not sure if it's supposed to.

@rjen

The 'problem' is a limitation of this pretty old solution for the grid...

If block 2 has a height larger then block 3, block 4 is effectively positioned under block 3 instead of under block 2. Block 5 then moves to the next line...

How to 'fix' the grid with this: make sure the content of block 3 is 'longer' then block 2. It does not make sense, I know, but that fixes the layout...
I'll see if I can change that to flex grid someday, that will make it work a lot better..
Running Latest TP on SMF2.1 at: www.fjr-club.nl

lurkalot

Quote from: @rjen on April 02, 2021, 09:42:34 PM
The 'problem' is a limitation of this pretty old solution for the grid...

If block 2 has a height larger then block 3, block 4 is effectively positioned under block 3 instead of under block 2. Block 5 then moves to the next line...


Yes, it's kind of confusing for me to get my head around, only because in my screenshot above all the blocks were identical size and type, but this still happened.  Flex grid sounds good though.  O0

tino

Quote from: lurkalot on April 02, 2021, 09:55:24 PM
Flex grid sounds good though.  O0

Flexbox and Grid are two different ways of doing largely the same thing btw. I don't think 'flex grid' is actually a thing. Although I am happy to be proved wrong.

Flex is a one dimensional pattern whereas grid is more two dimensional.

tino

Quote from: @rjen on April 02, 2021, 09:42:34 PM

How to 'fix' the grid with this: make sure the content of block 3 is 'longer' then block 2. It does not make sense, I know, but that fixes the layout...


You can probably get around it by setting the display to be a max-height and overflow hidden for the box.

Or just ensure the height of the div's are all the same.