Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeatable component won't expand #7414

Closed
lxndr opened this issue Aug 11, 2020 · 0 comments · Fixed by #7416
Closed

Repeatable component won't expand #7414

lxndr opened this issue Aug 11, 2020 · 0 comments · Fixed by #7416
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members

Comments

@lxndr
Copy link

lxndr commented Aug 11, 2020

Describe the bug
In content editor, repeatable component created by default cannot expand. Attempt to save such an entity causes error:

Something went wrong.
Details
TypeError: Cannot read property 'isOpen' of undefined

    in x
    in x
    in Unknown
    in div
    in styled.div
    in _
    in _
    in Unknown
    in div
    in div
    in styled.div
    in div
    in div
    in div
    in styled.div
    in form

I noticed that x is actually RepeatableComponent.

Entity:

{
  "kind": "collectionType",
  "collectionName": "tests",
  "info": {
    "name": "Test"
  },
  "options": {
    "increments": true,
    "timestamps": true
  },
  "attributes": {
    "title": {
      "type": "string",
      "required": false,
      "maxLength": 50
    },
    "show": {
      "type": "boolean",
      "default": true
    },
    "items": {
      "type": "component",
      "repeatable": true,
      "component": "story-items.story-item",
      "required": true,
      "min": 1
    }
  }
}

Component:

{
  "collectionName": "components_story_item_story_items",
  "info": {
    "name": "story-item",
    "icon": "file-alt"
  },
  "options": {},
  "attributes": {
    "title": {
      "type": "string",
      "required": true,
      "maxLength": 40
    },
    "description": {
      "type": "text",
      "required": false,
      "maxLength": 220
    },
    "picture": {
      "model": "file",
      "via": "related",
      "plugin": "upload",
      "required": false
    },
    "video": {
      "model": "file",
      "via": "related",
      "plugin": "upload",
      "required": false
    },
    "pictureSource": {
      "type": "string",
      "required": false,
      "default": ""
    }
  }
}

The only workaround I found was removing the default component entry and creating a new one.

Steps to reproduce the behavior

  1. Create component
  2. Create content type with the repeatable component andrequired:true, min:1
  3. Create entity of the type
  4. Click on default component, see it's not reacting
  5. Click Save
  6. See error

Expected behavior
Default component can be expanded. No error on save.

System

  • Node.js version: v14.6.0
  • NPM version: 6.14.7
  • Strapi version: 3.1.3
  • Database: postgres
  • Operating system: linux
soupette added a commit that referenced this issue Aug 11, 2020
Signed-off-by: soupette <cyril.lpz@gmail.com>
@soupette soupette added severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members issue: bug Issue reporting a bug labels Aug 11, 2020
@soupette soupette mentioned this issue Aug 11, 2020
alexandrebodin added a commit that referenced this issue Aug 12, 2020
gilfernandes pushed a commit to onepointconsulting/strapi that referenced this issue Aug 13, 2020
Signed-off-by: soupette <cyril.lpz@gmail.com>
Signed-off-by: Gil Fernandes <gil.fernandes@onepointltd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Issue reporting a bug severity: medium If it breaks the basic use of the product but can be worked around source: core:content-manager Source is core/content-manager package status: confirmed Confirmed by a Strapi Team member or multiple community members
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants