koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug(Schema): `Schema.array()` 中的 `Schema.union()` 只有一项时无法选择 #1290

Closed Lipraty closed 11 months ago

Lipraty commented 12 months ago

Describe the bug

当 Schema.union 只有一项时,无法选择该项。

Steps to reproduce

foo: Schema.array(Schema.object({
    bar: Schema.union(['baz'])
})).role('table')

Expected behavior

能够选中 baz

Screenshots

多个选项,能够选择:

f7c95aacf2b841c6799904e9d587ee5a c116ad7a4c3d6d0cf1ed2b7e07bb9d31

单个选项,不能选择:

image fd90852d480b51a0b3d27fac06f1b743

Versions

System: OS: Linux 5.10 Debian GNU/Linux 11 (bullseye) 11 (bullseye) CPU: (4) x64 Common KVM processor

Binaries: Node: 19.3.0 Yarn: 1.22.19

Koishi: Core: 4.15.4 Console: 5.18.4

Additional context

No response

shigma commented 11 months ago

最新版本未复现此问题。

460a93ef1985b2ac724a4c82243b0cae

09557726c7ef335779decfa157c54ed3

Lipraty commented 11 months ago

有可能是本地环境问题,先 close 了