Pylons / Pylons/deform

Accordion and SequenceWidget

Open
#347 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug needs-pr should backport
Dominant language
JavaScript
Stars
423
Forks
158
PR merge metrics
No merged PRs in 30d

Description

Mixing accordion exemple with SequenceWidget and Select2Widget leads to some strange behaviour:

  • accordion of the first element work, the others can't be opened/closed
  • css of Select2Widget inside the accordion seems have some issues.

version: deform==2.0.4

Here some code to illustrate:

choices = (('test1', 'Test 1'),
                   ('test2', 'Test 2'),
                   ('test3', 'Test 3'))

## Inside the accordion
class ClipParameterSchema(colander.Schema):
    not_available_for = colander.SchemaNode(
                colander.Set(),
                validator=colander.Length(max=10),
                widget=deform.widget.Select2Widget(
                    values=choices,
                    multiple=True),
                missing=[]
                )
    only_available_for = colander.SchemaNode(
                colander.Set(),
                validator=colander.Length(max=1),
                widget=deform.widget.Select2Widget(
                    values=choices,
                    multiple=True),
                missing=[],
                )
    until = colander.SchemaNode(
                colander.Date(),
                missing=colander.drop
                )

## Schema with an accordion
class ClipSchema(colander.Schema):
    upload = colander.SchemaNode(
            deform.FileData(),
            widget=deform.widget.FileUploadWidget(tmpstore)
            )
    parameters = ClipParameterSchema(
                        title="Clip parameters",
                        widget=deform.widget.MappingWidget(
                        template="mapping_accordion",
                        open=False))

## Sequence of schema with  an accordion
class ClipSequence(colander.SequenceSchema):
    upload = ClipSchema()

And a screen shot here:
deform_accordion_issues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided ClipSequence example with MappingWidget using the mapping_accordion template, Select2Widget, and deform 2.0.4. Trace the accordion and Select2 behavior in the rendered form; done means every accordion item opens and closes correctly and Select2 styling remains correct inside the accordion.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, python
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.