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

minH,minW,maxH,maxW properties is not working when resizeable is false and not getting applied to grid items inline style property. #63

Open
shahnawaz09 opened this issue Sep 10, 2022 · 2 comments
Labels
bug Something isn't working discussion Discussion about anything related to this repo

Comments

@shahnawaz09
Copy link

shahnawaz09 commented Sep 10, 2022

1 ) minH, minW, maxH, maxW these properties are not getting applied in grid items style property. These properties work only in resizeable=true mode. But not when I try to set "h" less then "minH". It is setting the less height which is less than minH. I think this should not happen. Please help me in this information.
I am facing a issue that I want the height dynamic of grid items. It should adjust based on content div height with resizeable=false. Now I am not able to achieve this. I am adding min-height to grid items manually and I was trying to remove the height property from the grid items by JavaScript but its not getting removed and getting automatically applied to grid items again which is weird. I am trying to do this to make the responsive/dynamic height to work by removing the "height" property and setting just the "min-height" property. And the content will also have min-height then my dynamic or responsive height issue will be resolved. Could you please help me on to achieve. How can i make grid items height adjust automatically with content height ?

  1. Second issue I am facing is that grid items add horizontal scroll to my page with cols="12" rowHeight="50" and widths of grid items are 3,6,3. but this is causing horizontal scroll. We are using vertical compaction.
    [
    { id: '1', x: 0, y: 0, w: 3, h: 8 },
    { id: '2', x: 3, y: 0, w: 6, h: 9.8 },
    { id: '3', x: 9, y: 0, w: 3, h: 11.3 },
    { id: '4', x: 0, y: 11, w: 3, h: 10, minH:5,minW:3},
    { id: '5', x: 3, y: 12.8, w: 6, h: 10 },
    { id: '6', x: 9, y: 14.3, w: 3, h: 10 }
    ];
    @llorenspujol Could you please reply on this.
@shahnawaz09 shahnawaz09 changed the title minH,minW,maxH,maxW properties is not working and not getting applied to grid item. minH,minW,maxH,maxW properties is not working when resizeable is false and not getting applied to grid item inline style property. Sep 10, 2022
@shahnawaz09 shahnawaz09 changed the title minH,minW,maxH,maxW properties is not working when resizeable is false and not getting applied to grid item inline style property. minH,minW,maxH,maxW properties is not working when resizeable is false and not getting applied to grid items inline style property. Sep 10, 2022
@llorenspujol
Copy link
Contributor

Hi @shahnawaz09 , you are right, minH, minW, maxH, maxW only work as constraints when doing 'resize' actions (right now). It is true that can seem weird that given a 'h' less than its 'minH', the final result is the 'h' itself. But is also weird to push a layout with an 'h' less than its 'minH' ( You can just do h = Math.max(h, minH ) before pushing the layout).
It overall works like that for having 'h' and 'w' always represents the value on screen, that make things easier.

Said that, I totally agree that it would be better to work as you said, but is not priority for the main case of grid layout since is easily solved. If I am missing something (maybe is not that easily solved) it would be nice that you provide some playground example with your exact use case.

I read your problems, I think you are using angular-grid-layout in a ways it is not designed too. Height of row items is NOT dynamic. Said that, there is an issue opened time ago, that was planning to add rowHeight = 'fit' that would make row height dynamic. It may solve your use case, check it please.

@llorenspujol
Copy link
Contributor

@shahnawaz09 about the horizontal scroll, There is an identified issue that layout is not well calculated when vertical scroll appears. That is what is happening to you. One workaround is adding some padding to the grid container. Another one is just call grid.resize() to recalculate the layout.

The vertical scroll taking space of the grid that make us recalculate the layout is not as easy as it seems. The only thing that can be done now is as @Devin-Harris made here. It only solves it onInit, but for now is the only enhancement we can do.

@llorenspujol llorenspujol added bug Something isn't working discussion Discussion about anything related to this repo labels Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working discussion Discussion about anything related to this repo
Projects
None yet
Development

No branches or pull requests

2 participants