From 96d934d592ff37497734e113248b7c6e79348ab8 Mon Sep 17 00:00:00 2001 From: Misode Date: Mon, 27 Sep 2021 23:56:10 +0200 Subject: [PATCH] Fix #170 and fix #171 by only updating strings onBlur --- src/app/schema/renderHtml.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/schema/renderHtml.tsx b/src/app/schema/renderHtml.tsx index 5d8809d0..35df7513 100644 --- a/src/app/schema/renderHtml.tsx +++ b/src/app/schema/renderHtml.tsx @@ -362,12 +362,13 @@ function StringSuffix({ path, getValues, config, node, value, lang, states }: No const onChange = (evt: Event) => { evt.stopPropagation() const newValue = (evt.target as HTMLSelectElement).value + if (newValue === value) return path.model.set(path, newValue.length === 0 ? undefined : newValue) } const values = getValues() const context = path.getContext().join('.') if (nbtFields.includes(context)) { - return + return } else if ((isEnum(config) && !config.additional) || selectRegistries.includes(context)) { let context = new Path([]) if (isEnum(config) && typeof config.enum === 'string') { @@ -390,7 +391,7 @@ function StringSuffix({ path, getValues, config, node, value, lang, states }: No } else { const datalistId = hexId() return <> - 0 ? datalistId : ''} /> {values.length > 0 && {values.map(v =>