interface
interface copied to clipboard
`<SelectField>`: `defaultValue` does not work as expected
Hi, Let me simplify my problem.
I have this schema.
export class Category {
name = def.stringColumn().notNull()
articles = def.oneHasMany(Article, 'articles')
}
export class Article {
name = def.stringColumn().notNull()
category = def.manyHasOne(Category, 'articles')
}
Then I have this simple form
const ArticleForm = Component(
() => (
<>
<TextField field="name" label="Name" />
<SelectField field="category" label="Category" options="Category.name" defaultValue="62522664-1681-49a8-85c9-21998ef4158c" />
</>
),
)
export default () => (
<CreatePage
entity="Article"
>
<ArticleForm />
</CreatePage>
)
This will not throw any error and also not "preselect" Category with id 62522664-1681-49a8-85c9-21998ef4158c
.