Skip to content

Commit

Permalink
fix: formular confirm error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jocs committed May 25, 2024
1 parent 6e6f185 commit c4cc621
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ export class EndEditController extends Disposable {
this._cursorStateListener();
}

// eslint-disable-next-line max-lines-per-function
private _initialExitInput() {
this.disposeWithMe(
// eslint-disable-next-line max-lines-per-function
this._editorBridgeService.visible$.subscribe(async (param) => {
const { visible, keycode, eventType } = param;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
* limitations under the License.
*/

/* eslint-disable complexity */
/* eslint-disable max-lines-per-function */

import type {
IRange,
IRangeWithCoord,
Expand Down Expand Up @@ -295,7 +298,7 @@ export class SelectionRenderService implements ISelectionRenderService {

const skeleton = this._skeleton;

let style = data.style;
let { style } = data;

if (style == null) {
style = getNormalSelectionStyle(this._themeService);
Expand All @@ -309,6 +312,7 @@ export class SelectionRenderService implements ISelectionRenderService {

const control = new SelectionShape(scene, currentControls.length, this._isHeaderHighlight, this._themeService);

// eslint-disable-next-line no-new
new SelectionShapeExtension(control, skeleton, scene, this._themeService, this._injector);

const { rowHeaderWidth, columnHeaderHeight } = skeleton;
Expand All @@ -324,12 +328,6 @@ export class SelectionRenderService implements ISelectionRenderService {
currentControls.push(control);
}

/**
* update selection
* @param selectionRange
* @param curCellRange
* @returns
*/
updateControlForCurrentByRangeData(selections: ISelectionWithCoordAndStyle[]) {
const currentControls = this.getCurrentControls();
if (!currentControls) {
Expand Down
9 changes: 9 additions & 0 deletions packages/sheets/src/services/selection-manager.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,20 @@ export class SelectionManagerService implements IDisposable {
if (this._currentSelection == null) {
return;
}

// Fetch the old selections.
const selections = this.getSelectionDatasByParam(this._currentSelection);

this._currentSelection = {
pluginName,
unitId: this._currentSelection?.unitId,
sheetId: this._currentSelection?.sheetId,
};

// Store the selection with the new pluginName.
if (selections != null) {
this.add([...selections]);
}
}

reset() {
Expand Down

0 comments on commit c4cc621

Please sign in to comment.