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

Angular - Issue with category element #2343

Open
thtran1 opened this issue Jun 3, 2024 · 1 comment
Open

Angular - Issue with category element #2343

thtran1 opened this issue Jun 3, 2024 · 1 comment
Milestone

Comments

@thtran1
Copy link

thtran1 commented Jun 3, 2024

Describe the bug

I’m encountering an issue with the category element.
At the first time, when i click “add element” on the second tab, i am redirect to the first tab.
Why does this behavior occur ? All subsequent clicks on “add” after the first one function as anticipated. I’m using Angular 16 with jsonForms 3.2.1.
Seems to occur also with jsonForms 3.3.0.

schema = {
    type: "object",
    properties: {
      parc: {
        type: "array",
        items: {
          type: "object",
          properties: {
            id: {
              type: "string",
            },
          },
        },
      },
    },
  };

  uischema = {
    type: "VerticalLayout",
    elements: [
      {
        type: "Categorization",
        elements: [
          {
            type: "Category",
            label: "A1",
            elements: [
              {
                type: "Control",
                scope: "#/properties/parc",
                options: {
                  detail: {
                    type: "VerticalLayout",
                    elements: [
                      {
                        type: "HorizontalLayout",
                        elements: [
                          {
                            type: "Control",
                            scope: "#/properties/id",
                          },
                        ],
                      },
                    ],
                  },
                },
              },
            ],
          },
          {
            type: "Category",
            label: "A2",
            elements: [
              {
                type: "Control",
                scope: "#/properties/parc",
                options: {
                  detail: {
                    type: "VerticalLayout",
                    elements: [
                      {
                        type: "HorizontalLayout",
                        elements: [
                          {
                            type: "Control",
                            scope: "#/properties/id",
                          },
                        ],
                      },
                    ],
                  },
                },
              },
            ],
          },
        ],
      },
    ],
  };

  data = "{}";

<jsonforms
  [data]="data"
  [schema]="schema"
  [uischema]="uischema"
  [renderers]="renderers"
></jsonforms>

Expected behavior

When click on "add" in the 2nd tab, new element must be added and we must stay on the 2nd tab.

Steps to reproduce the issue

  1. Go to '2nd tab'
  2. Click on 'add'
  3. error : add ok but redirect to 1st tab

Screenshots

No response

Which Version of JSON Forms are you using?

v3.3.0

Framework

Angular

RendererSet

Material

Additional context

No response

@sdirix
Copy link
Member

sdirix commented Jun 4, 2024

Hi @thtran1,

Thanks for the report! This is certainly a bug!

@sdirix sdirix added this to the 3.x milestone Jun 4, 2024
@lucas-koehler lucas-koehler modified the milestones: 3.x, 4.x Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants