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

Blocks: Improve block mover scroll position preserve #3595

Closed
aduth opened this issue Nov 21, 2017 · 0 comments
Closed

Blocks: Improve block mover scroll position preserve #3595

aduth opened this issue Nov 21, 2017 · 0 comments
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended

Comments

@aduth
Copy link
Member

aduth commented Nov 21, 2017

Related: #3546

The current behavior for preserving scroll offset when moving blocks checks whether the current block is selected:

componentWillReceiveProps( newProps ) {
if (
this.props.order !== newProps.order &&
( ( this.props.isSelected && newProps.isSelected ) ||
( this.props.isFirstMultiSelected && newProps.isFirstMultiSelected ) )
) {
this.previousOffset = this.node.getBoundingClientRect().top;
}
}

This means that when merely hovering a block and using the Block Mover arrows to rearrange the block, scroll will not be preserved on the first click. Subsequent clicks will preserve position because the block is automatically selected when moved.

We should consider...

  • Refactoring to rely less on explicit selected state
  • Ensure that isSelected takes effect before deciding to assign this.previousOffset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

1 participant