fix: getFieldComponentRef will return actual ref within AsyncComponentWrapper (#6252)

修复异步加载组件时,表单的getFieldComponentRef方法没能获取到正确的组件实例
This commit is contained in:
Netfan
2025-05-21 14:48:51 +08:00
committed by GitHub
parent 8ac97688da
commit 0c3edb10b0
2 changed files with 21 additions and 4 deletions

View File

@@ -134,7 +134,7 @@ function handleClick(
}
case 'componentRef': {
// 获取下拉组件的实例并调用它的focus方法
formApi.getFieldComponentRef<RefSelectProps>('fieldOptions')?.focus();
formApi.getFieldComponentRef<RefSelectProps>('fieldOptions')?.focus?.();
break;
}
case 'disabled': {