diff --git a/src/app/components/generator/McdocRenderer.tsx b/src/app/components/generator/McdocRenderer.tsx
index f2b9629f..44dff9d2 100644
--- a/src/app/components/generator/McdocRenderer.tsx
+++ b/src/app/components/generator/McdocRenderer.tsx
@@ -101,6 +101,14 @@ function StringHead({ type, node, makeEdit, ctx }: StringHeadProps) {
})
}, [node, makeEdit])
+ const idAttribute = type.attributes?.find(a => a.name === 'id')?.value
+ const idRegistry = idAttribute?.kind === 'literal' && idAttribute.value.kind === 'string'
+ ? idAttribute.value.value
+ : idAttribute?.kind === 'tree' && idAttribute.values.registry?.kind === 'literal' && idAttribute.values.registry?.value.kind === 'string'
+ ? idAttribute.values.registry?.value.value
+ : undefined
+ const isSelect = idRegistry && selectRegistries.has(idRegistry)
+
const completions = useMemo(() => {
return getValues(type, { ...ctx, offset: node?.range.start ?? 0 })
.filter(c => c.kind === 'string')
@@ -117,10 +125,16 @@ function StringHead({ type, node, makeEdit, ctx }: StringHeadProps) {
}, [onChangeValue])
return <>
- {completions.length > 0 && }
- onChangeValue((e.target as HTMLInputElement).value)} list={completions.length > 0 ? datalistId : undefined} />
+ {isSelect ? <>
+
+ > : <>
+ {completions.length > 0 && }
+ onChangeValue((e.target as HTMLInputElement).value)} list={completions.length > 0 ? datalistId : undefined} />
+ >}
{colorKind === 'hex_rgb' && <>
onChangeValue((e.target as HTMLInputElement).value)} />
@@ -170,7 +184,7 @@ function EnumHead({ type, optional, node, makeEdit }: EnumHeadProps) {
return
}
@@ -271,7 +285,7 @@ function UnionHead({ type, optional, node, makeEdit, ctx }: UnionHeadProps) {
{(selectedType || !optional) &&