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

fix(sheet): selection order #2557

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(sheet): selection order
  • Loading branch information
DR-Univer committed Jun 19, 2024
commit a8f8bbfa9909cadab4bd4c0b74df97522af8d3d5
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ export class SelectionRenderController extends Disposable implements IRenderModu
private _initSelectionChangeListener() {
this.disposeWithMe(
toDisposable(
this._selectionManagerService.selectionMoveEnd$.subscribe((params) => {
this._selectionManagerService.selectionMoveEndBefore$.subscribe((params) => {
this._selectionRenderService.reset();
if (params == null) {
return;
Expand Down
4 changes: 4 additions & 0 deletions packages/sheets/src/services/selection-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export class SelectionManagerService implements IDisposable {
private readonly _selectionMoveEnd$ = new BehaviorSubject<Nullable<ISelectionWithStyle[]>>(null);
readonly selectionMoveEnd$ = this._selectionMoveEnd$.asObservable();

private readonly _selectionMoveEndBefore$ = new BehaviorSubject<Nullable<ISelectionWithStyle[]>>(null);
readonly selectionMoveEndBefore$ = this._selectionMoveEndBefore$.asObservable();

private _dirty: boolean = true;

// FIMXE: this dependency is not correct!
Expand Down Expand Up @@ -340,6 +343,7 @@ export class SelectionManagerService implements IDisposable {
}

private _refresh(param?: ISelectionManagerSearchParam): void {
this._selectionMoveEndBefore$.next(this._getSelectionDatas(param));
this._selectionMoveEnd$.next(this._getSelectionDatas(param));
}

Expand Down
Loading