Feedback: Enum/Select in schema fields #859

This commit is contained in:
Elio Struyf
2024-10-28 14:41:50 +01:00
parent c84af8493b
commit fc96c8922c
2 changed files with 5 additions and 2 deletions

View File

@@ -9,6 +9,7 @@
### 🐞 Fixes
- [#859](https://github.com/estruyf/vscode-front-matter/issues/859): Fix label in the data view dropdown field
- [#876](https://github.com/estruyf/vscode-front-matter/issues/876): Fix snippet type on the snippet card
- [#879](https://github.com/estruyf/vscode-front-matter/issues/879): Fix for auto updating last modified date on save

View File

@@ -42,6 +42,7 @@ function Select({
...props
}: SelectFieldProps) {
const multiple = fieldType === Array;
return (
<div className="autoform__select_field" {...filterDOMProps(props)}>
<LabelField label={label} id={id} required={required} />
@@ -84,11 +85,12 @@ function Select({
}}
ref={inputRef}
value={value ?? ''}
className='text-[var(--vscode-foreground)] bg-[var(--vscode-list-activeSelectionBackground)] rounded-[2px] active:border-transparent disabled:opacity-40 disabled:cursor-not-allowed focus:outline-none'
style={{ width: '100%', padding: '0.5rem' }}
>
{(!!placeholder || !required || value === undefined) && !multiple && (
{(!required || value === undefined) && !multiple && (
<option value="" disabled={required} hidden={required}>
{placeholder || label}
{""}
</option>
)}