mirror of
https://github.com/dream-num/univer.git
synced 2026-09-24 15:32:18 +08:00
feat: disable confirm btn if function info after use search is null (#6477)
Co-authored-by: r.sergeev <r.sergeev@yadro.com>
This commit is contained in:
co-authored by
r.sergeev
parent
f4d7d03ec3
commit
868ec826ef
@@ -87,6 +87,7 @@ export function MoreFunctions() {
|
||||
)}
|
||||
{selectFunction && !!workbook && (
|
||||
<Button
|
||||
disabled={!functionInfo}
|
||||
variant="primary"
|
||||
onClick={handleConfirm}
|
||||
className="univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0"
|
||||
|
||||
+3
-1
@@ -30,7 +30,7 @@ import { FunctionHelp } from '../function-help/FunctionHelp';
|
||||
import { FunctionParams } from '../function-params/FunctionParams';
|
||||
|
||||
export interface ISelectFunctionProps {
|
||||
onChange: (functionInfo: IFunctionInfo) => void;
|
||||
onChange: (functionInfo: IFunctionInfo | null) => void;
|
||||
}
|
||||
|
||||
export function SelectFunction(props: ISelectFunctionProps) {
|
||||
@@ -102,6 +102,7 @@ export function SelectFunction(props: ISelectFunctionProps) {
|
||||
const setCurrentFunctionInfo = (selectedIndex: number) => {
|
||||
if (selectList.length === 0) {
|
||||
setFunctionInfo(null);
|
||||
onChange(null);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -109,6 +110,7 @@ export function SelectFunction(props: ISelectFunctionProps) {
|
||||
const functionInfo = descriptionService.getFunctionInfo(selectList[selectedIndex].name);
|
||||
if (!functionInfo) {
|
||||
setFunctionInfo(null);
|
||||
onChange(null);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user