AndrewHaine / statamic-accordion-group

Stash groups of fields from long fieldsets away in accordion-style toggle boxes.
MIT License
1 stars 1 forks source link

A few improvements #1

Closed pxwee5 closed 4 years ago

pxwee5 commented 5 years ago

image Image speaks louder than words.

EDIT: This works flawlessly when it's not in a replicator. In the screenshot, the accordion_group is added to a replicator.

Fix for Padding

add this to line 91.

    fieldClasses(field) {
      return [
        "form-group",
        "p-2",
        field.type + "-fieldtype",
        tailwind_width_class(field.width),
        field.classes || ""
      ];
    }

Not sure how we can fix the ReplicatorSet generated headers without changing the name for instruction and title.

pxwee5 commented 5 years ago

Also to fix this selects not overflowing from the accordion. image

.accordion-field__body {
  max-height: 0;
  /* overflow: hidden; */
}

And then

<div class="accordion-field__body" :class="{ 'invisible' : !isOpen }">
AndrewHaine commented 5 years ago

Hi @pxwee5 , Thank you for highlighting these issues and for providing solutions! I have implemented the fixes and released in v1.0.1

pxwee5 commented 5 years ago

You should really have a look at how ReplicatorFieldtype does it, it's cleaner IMO.