mirror of
https://github.com/teableio/teable
synced 2024-11-22 15:31:39 +00:00
fix: link editor cannot unselect (#363)
* fix: the many-to-one relationship link editor cannot deselect * fix: formula FIND and SEARCH return type error
This commit is contained in:
parent
e5ea44ff65
commit
37be99f516
@ -66,7 +66,7 @@ export class Find extends TextFunc {
|
||||
|
||||
getReturnType(params?: TypedValue[]) {
|
||||
params && this.validateParams(params);
|
||||
return { type: CellValueType.String };
|
||||
return { type: CellValueType.Number };
|
||||
}
|
||||
|
||||
eval(params: TypedValue<string | number | null | (string | number | null)[]>[]): number | null {
|
||||
@ -96,7 +96,7 @@ export class Search extends TextFunc {
|
||||
|
||||
getReturnType(params?: TypedValue[]) {
|
||||
params && this.validateParams(params);
|
||||
return { type: CellValueType.String };
|
||||
return { type: CellValueType.Number };
|
||||
}
|
||||
|
||||
eval(params: TypedValue<string | number | null | (string | number | null)[]>[]): number | null {
|
||||
|
@ -99,10 +99,17 @@ export const useSelection = (props: IUseSelectionProps) => {
|
||||
|
||||
const pureSelectColumnOrRow = (colOrRowIndex: number, type: SelectionRegionType) => {
|
||||
const range = [colOrRowIndex, colOrRowIndex] as IRange;
|
||||
const newSelection =
|
||||
isPrevRowSelection && isMultiSelectionEnable
|
||||
? selection.merge(range)
|
||||
: selection.set(type, [range]);
|
||||
let newSelection;
|
||||
|
||||
if (
|
||||
isPrevRowSelection &&
|
||||
(isMultiSelectionEnable ||
|
||||
(!isMultiSelectionEnable && prevSelectionRanges[0][0] === colOrRowIndex))
|
||||
) {
|
||||
newSelection = selection.merge(range);
|
||||
} else {
|
||||
newSelection = selection.set(type, [range]);
|
||||
}
|
||||
if (newSelection.includes(range)) {
|
||||
prevSelectedRowIndex.current = colOrRowIndex;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user