Skip to content

React Vanilla Categorization Renderer should handle updated schemas #2097

@sdirix

Description

@sdirix

Describe the bug

The React Vanilla Categorization renderer maintains local state about the currently selected category. This state is not properly updated when the UI Schema changes and therefore may return a previous category which no longer fits the JSON Schema.

Expected behavior

Whenever a prop of the React Vanilla Categorization renderer changes it should update accordingly.

Steps to reproduce the issue

  1. Render a categorization with React Vanilla
  2. Select a category
  3. Replace schema and uischema with a new Categorization but whose content is completely different
  4. Still the old category of the previous uischema is used, leading for example to "No applicable cell" errors

The problematic code seems to be here.

Screenshots

No response

In which browser are you experiencing the issue?

n/a

Which Version of JSON Forms are you using?

3.0.0

Framework

React

RendererSet

Vanilla

Additional context

Reported in this discussion

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions