From 9b11bdcdc46d5699abf284fb1f8771344b577373 Mon Sep 17 00:00:00 2001 From: liaoxuezhi <2698393+2betop@users.noreply.github.com> Date: Sat, 11 May 2024 11:54:12 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20select=20=E4=B8=8D=E5=9C=A8=20form=20?= =?UTF-8?q?=E4=B8=8B=E9=9D=A2=E6=8A=A5=20addHook=20=E4=B8=8D=E6=98=AF?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E7=9A=84=E9=94=99=E8=AF=AF=20(#10214)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/amis/src/renderers/Form/Select.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/amis/src/renderers/Form/Select.tsx b/packages/amis/src/renderers/Form/Select.tsx index aa982e826..69c00166d 100644 --- a/packages/amis/src/renderers/Form/Select.tsx +++ b/packages/amis/src/renderers/Form/Select.tsx @@ -341,7 +341,10 @@ export default class SelectControl extends React.Component { if (!formInited) { this.unHook && this.unHook(); - return (this.unHook = addHook(this.loadRemote.bind(this, input), 'init')); + return ( + addHook && + (this.unHook = addHook(this.loadRemote.bind(this, input), 'init')) + ); } this.lastTerm = input;