Skip to content

Fix sliding when resizing with minimum limits reached#3433

Merged
miina merged 18 commits intodevelopfrom
fix/3397-resizing-min-limit
Oct 4, 2019
Merged

Fix sliding when resizing with minimum limits reached#3433
miina merged 18 commits intodevelopfrom
fix/3397-resizing-min-limit

Conversation

@miina
Copy link
Copy Markdown
Contributor

@miina miina commented Oct 3, 2019

Summary

Fixes #3397
Fixes #3326

  • Unskips the resizing tests.
  • Prevents position change when minimum limits have been reached when reducing the width/height.
  • Prevents scrollHeight calculations to limit resizing if the Text block is empty anyway.

Checklist

@googlebot googlebot added the cla: yes Signed the Google CLA label Oct 3, 2019
@miina
Copy link
Copy Markdown
Contributor Author

miina commented Oct 3, 2019

OK, found the reason for the tests being unreliable: there was an await missing 🤦‍♀

However, this brought out an actual additional bug when fit-text is turned off, so looking into that now.

@miina miina changed the title [TEST] [WIP] Fix sliding when resizing with minimum limits reached [WIP] Fix sliding when resizing with minimum limits reached Oct 3, 2019
@miina miina changed the title [WIP] Fix sliding when resizing with minimum limits reached Fix sliding when resizing with minimum limits reached Oct 3, 2019
@miina miina marked this pull request as ready for review October 3, 2019 19:16

// Rotate the block and try again.
await rotateSelectedBlock();
await dragAndResize( resizableHandleTop, { x: 300, y: 0 } );
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here you switch to dragging in x direction in stead of y direction after rotation. But in the above test, you drag in x both before and after rotation. I don't know which is the right one, but it seems to be this one, perhaps?

I guess that depends on how the item is rotated of course 😝.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hah! Good catch, thank you. The rotation is not enough for the initial direction not to work -- will leave a comment with degrees.

@barklund
Copy link
Copy Markdown
Contributor

barklund commented Oct 3, 2019

If you resize "quickly", then the item jumps when you reach minimum position, as it jumps to the last "legal" top position and minimum height from there in stead of minimum height based off the "static" bottom position.

This is particularly obvious with a rotated block, but happens for non-rotated ones as well.

I tried to see, if I could fix this, but I just can't wrap my head around it. Maybe for non-rotated blocks, but definitely couldn't figure it out for the rotated ones.

Screen Recording 2019-10-03 at 17 07 27

@miina
Copy link
Copy Markdown
Contributor Author

miina commented Oct 4, 2019

Thanks for testing! I think I remember seeing this "jumpiness" on quick resizing from before as well, it's not easy to test on develop though since currently the block slides away instead (without this PR).

Will try to look into this jumpiness as well in this PR, if it starts taking too much time then will create a separate issue instead.

@spacedmonkey
Copy link
Copy Markdown
Contributor

I am going to wait to code review until the "jumpiness" is fixed.

@miina
Copy link
Copy Markdown
Contributor Author

miina commented Oct 4, 2019

Added a new issue for the jumpiness. It's unrelated to the original issue anyway and possibly lower priority, too.
#3444

@swissspidy
Copy link
Copy Markdown
Collaborator

Still seeing the issue: https://cloudup.com/cRZMrlUPdy8

@miina
Copy link
Copy Markdown
Contributor Author

miina commented Oct 4, 2019

Still seeing the issue: https://cloudup.com/cRZMrlUPdy8

Hmm, that seems to be a different issue -- the original issue is for the position continuing to change even though the minimum limits have been reached and it's not possible to reduce anymore (in case of amp-fit-text turned off).

I'll debug this new finding as well to see if it seems to be an easy fix. For testing/QA purposes might be good to track that as a different issue though.

Looks like that's for when "amp-fit-text" is turned on, right?

@swissspidy
Copy link
Copy Markdown
Collaborator

Looks like that's for when "amp-fit-text" is turned on, right?

Correct. A separate issue is fine for me. Thanks for having a look!

@swissspidy swissspidy added this to the v1.3.1 milestone Oct 4, 2019
Copy link
Copy Markdown
Collaborator

@swissspidy swissspidy left a comment

Choose a reason for hiding this comment

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

The proposed changes here work well. Related issues with resizing have been brought up, but these can be addressed in separate PRs.

@miina
Copy link
Copy Markdown
Contributor Author

miina commented Oct 4, 2019

OK, looks like the tests have passed a few times in a row now.

@miina miina merged commit 5b2ae2f into develop Oct 4, 2019
@miina miina deleted the fix/3397-resizing-min-limit branch October 4, 2019 18:49
@barklund barklund mentioned this pull request Oct 15, 2019
3 tasks
@swissspidy swissspidy modified the milestones: v1.3.1, v1.4 Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resizing Text block: Trying to resize smaller than possible moves the position Unskip resizing test after bugfix

5 participants