estruyf / vscode-front-matter

Front Matter is a CMS running straight in Visual Studio Code. Can be used with static site generators like Hugo, Jekyll, Hexo, NextJs, Gatsby, and many more...
https://frontmatter.codes
MIT License
1.95k stars 77 forks source link

Issue: dataFile value selector not closing #716

Closed AlbertoFdzM closed 5 months ago

AlbertoFdzM commented 10 months ago

Describe the bug When defining dataFile fields the field selector doen't close

To Reproduce Steps to reproduce the behavior:

  1. Define a data file frontMatter.data.files:
    {
    "id": "authors",
    "title": "Authors",
    "file": "[[workspace]]/data/authors.json",
    "fileType": "json",
    "labelField": "slug",
    "schema": {
    "title": "Authors",
    "type": "object",
    "required": ["name", "slug"],
    "properties": {
      "name": {
        "type": "string",
        "title": "Name"
      },
      "slug": {
        "type": "string",
        "title": "Slug"
      }
    }
    }
    }
  2. Add a field using that dataFile:
    {
    "title": "Author",
    "name": "author",
    "type": "dataFile",
    "dataFileId": "authors",
    "dataFileKey": "slug",
    "dataFileValue": "slug",
    "multiple": false
    }
  3. Add 2 items to the data:
    [
    {
    "name": "Author A",
    "slug": "author-a"
    },
    {
    "name": "Author B",
    "nickname": "author-b"
    }
    ]
  4. Try to select a value in content editor

Expected behavior For the options' selector to close once an option is selected

Screenshots 2023-11-27-front-matter-select-error

Desktop (please complete the following information):

estruyf commented 10 months ago

@AlbertoFdzM thanks for reporting. Is it open already on load? Or once you clicked on the control?

AlbertoFdzM commented 6 months ago

@AlbertoFdzM thanks for reporting. Is it open already on load? Or once you clicked on the control?

It's already open on load.

Moreover, when there are multiple fields of this type, all of them appear open.

estruyf commented 6 months ago

Thanks @AlbertoFdzM, I found the issue and pushed a fix. You should be able to test it in the latest beta version.

AlbertoFdzM commented 6 months ago

Tested it. Seems to be working ok now. Thanks.