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

The y coordinate Increases after item resize if the cell height is 12 pixels or less #1855

Closed
icetomcat opened this issue Sep 16, 2021 · 2 comments · Fixed by #1877
Closed
Labels

Comments

@icetomcat
Copy link

icetomcat commented Sep 16, 2021

Subject of the issue

The y coordinate Increases after item resize if the cell height is 12 pixels or less

Your environment

gridstack 4.2.7 HTML5
Chrome 93.0.4577.63
Firefox 91.0.2

Steps to reproduce

Resize the item
https://jsfiddle.net/icetomcat/bsyj3pn5/6/

Expected behavior

Item resized without changing position

Actual behavior

Item resized with changing position

@icetomcat icetomcat changed the title Increases the y coordinate after item resize if the cell height is 12 pixels or less The y coordinate Increases after item resize if the cell height is 12 pixels or less Sep 16, 2021
@adumesny
Copy link
Member

adumesny commented Sep 16, 2021

note this doesn't happen if you have a margin of say 2. we reduce the height by margin (default 10) which happen to affect what row it lands on... yeah the math is off somewhere.
https://jsfiddle.net/adumesny/1cgou9Lj/

adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 18, 2021
* fix gridstack#1855
* reduce padding when calculating mid point if more than 10% of the cell height/width so it doesn't throw off calculations
adumesny added a commit to adumesny/gridstack.js that referenced this issue Oct 18, 2021
* fix gridstack#1855
* reduce padding when calculating mid point if more than 10% of the cell height/width so it doesn't throw off calculations
@adumesny
Copy link
Member

fixed in next release - don't forget to donate if you find this li useful!

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 a pull request may close this issue.

2 participants