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

Array of objects template EDIT: collapse does not work with Bootstrap 5 #246

Open
Timo-Breumelhof opened this issue Sep 18, 2024 · 5 comments
Assignees
Labels

Comments

@Timo-Breumelhof
Copy link
Collaborator

Timo-Breumelhof commented Sep 18, 2024

I created a template with an array of videos.

Schema:

{
  "type": "object",
  "properties": {
    "videos": {
      "type": "array",
      "title": "videos",
      "items": {
        "type": "object",
        "properties": {
          "Title": {
            "type": "string",
            "title": "Video title"
          },
          "YouTubeId": {
            "type": "string",
            "title": "You Tube Id"
          }
        }
      }
    }
  }
}

Options:

{
  "fields": {
    "videos": {
      "type": "accordion",
      "items": {
        "fields": {
          "Title": {
            "type": "text"
          },
          "YouTubeId": {
            "type": "url"
          }
        }
      }
    }
  }
}

This works in Bootstrap 4 but in Bootstrap 5 it does not.
In that case the accordion opens and immediately closes again (it gets two click event I guess)
The "fix" for this is to use the new builder.
You should not forget to remove

"type": "accordion",

from the options file though

@Timo-Breumelhof
Copy link
Collaborator Author

Example template
OC-Array-Of-Objects.zip
attached

@b-creative
Copy link

I think you can also just delete the line in options.json
"type": "accordion",

@Timo-Breumelhof
Copy link
Collaborator Author

I think you can also just delete the line in options.json "type": "accordion",

I thought so too but got an error. Might have been something else, I'll try again

@Timo-Breumelhof
Copy link
Collaborator Author

You a right, I guess I mixed two things up (testing on 3 different installs ;-)

@Timo-Breumelhof
Copy link
Collaborator Author

@b-creative text changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants