sanity-io / sanity-plugin-internationalized-array

A plugin to register array fields with a custom input component to store field values in multiple languages, queryable by using the language ID as an array `_key`.
MIT License
43 stars 11 forks source link

Unable to use internationalizedArrayText #61

Closed kosjak95 closed 7 months ago

kosjak95 commented 8 months ago

Describe the bug It is not possible to add internationalizedArrayText. After registering the field type in sanity.config.ts and try to use it in my field it throws an runtime exception realted to textInputRepresentationStyle

No difference if I will try use defined type 'text' in fieldTypes or try to hack it with creating my own type with text inside, if only it contains text it is not able to create it after opening the internationalized field value.

To Reproduce

  1. internationalizedArray({ languages: [ {id: 'da', title: 'Danish'}, {id: 'en', title: 'English'} ], defaultLanguages: ['da'], fieldTypes: ['string', 'text'], })

  2. defineField({ name: 'content', type: 'internationalizedArrayText', title: 'Content', })

  3. try to insert content.

Expected behavior

The internationalized array of texts render, open and be able to consume text.

Screenshots image

Which versions of Sanity are you using?

Run sanity versions in the terminal and copy-paste the result here.

@sanity/cli (global) 3.23.1 (latest: 3.28.0) @sanity/eslint-config-studio 3.0.1 (up to date) @sanity/vision 3.23.1 (latest: 3.28.0) sanity 3.23.1 (latest: 3.28.0)

What operating system are you using? windows

Which versions of Node.js / npm are you running? Node.js v18.12.1. yarn 1.22.19

SimeonGriggs commented 7 months ago

Unable to reproduce, are you using the latest version of the Studio and plugin?