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
[FIX] Selection: Altering selection should scroll the viewport #1775
Conversation
c143b27
to
c6ac43b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only details
this.autofillZone = undefined; | ||
this.selection.resizeAnchorZone(this.direction, this.steps); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep, looks like what it should have been from the start
@@ -142,7 +142,10 @@ export class SelectionStreamProcessor | |||
/** | |||
* Set the selection to one of the cells adjacent to the current anchor cell. | |||
*/ | |||
moveAnchorCell(direction: SelectionDirection, step: SelectionStep = "one"): DispatchResult { | |||
moveAnchorCell(direction: SelectionDirection, step: SelectionStep = 1): DispatchResult { | |||
if (step !== "end" && step <= 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work when step=0 ? Probably yes, but it's worth a test
src/helpers/zones.ts
Outdated
@@ -487,7 +487,7 @@ export function mergeOverlappingZones(zones: Zone[]) { | |||
export function findCellInNewZone( | |||
oldZone: Zone, | |||
currentZone: Zone, | |||
viewport: Viewport | |||
viewport?: Viewport |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe update the docstring to help understanding what impact the viewport has
49f77af
to
f22726e
Compare
Commit b437f44 introduced an error. while fixing the viewport scrolling while in autofill (it shouldn't happen) it also prevent an change of selection (not an extension) to properly scroll the viewport. The problem ultimately lies in the fact that the autofill was using the selectionProcessor to override its selection instead of extending it. In order to fix this, it was necessary to alter the API of the selection processor to allow more granularity in the steps to extend a zone selection: i.e. instead of a step of 1 or jump to the end of a zone, we need to support all POSITIVE values of steps. Task 3050101
f22726e
to
c39291e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
robodoo r+
Commit b437f44 introduced an error. while fixing the viewport scrolling while in autofill (it shouldn't happen) it also prevent an change of selection (not an extension) to properly scroll the viewport. The problem ultimately lies in the fact that the autofill was using the selectionProcessor to override its selection instead of extending it. In order to fix this, it was necessary to alter the API of the selection processor to allow more granularity in the steps to extend a zone selection: i.e. instead of a step of 1 or jump to the end of a zone, we need to support all POSITIVE values of steps. Task 3050101 closes #1775 Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Description:
description of this task, what is implemented and why it is implemented that way.
Odoo task ID : 3050101
review checklist