Skip to content

fix: update disabled status after rendering#7172

Merged
maribethb merged 2 commits into
RaspberryPiFoundation:developfrom
maribethb:disable
Jun 15, 2023
Merged

fix: update disabled status after rendering#7172
maribethb merged 2 commits into
RaspberryPiFoundation:developfrom
maribethb:disable

Conversation

@maribethb
Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide
  • I ran npm run format and npm run lint

The details

Resolves

Fixes #7113

Proposed Changes

Calls updateDisabled if the block is disabled during the render call for a block.

The reason this happened in JSON and not XML is that XML sets the disabled state after rendering. JSON sets it before rendering. When the block was eventually rendered in JSON, it looked correct because it had the correct enabled property, but the visuallyDisabled property was not set (because the block was not rendered at the time of the original updateDisabled call). So this just calls that function again during render which updates the state as needed.

Behavior Before Change

See detailed reproduction steps in linked bug. If you loaded from json, the block would look and be disabled, but the block's visuallyDisabled property was not set. So the visual state would be out of sync with the actual state of the block.

Behavior After Change

Disabled blocks loaded from json behave as expected.

Reason for Changes

bug fixes

Test Coverage

manual testing, added test case

Documentation

no

Additional Information

@maribethb maribethb requested a review from a team as a code owner June 15, 2023 18:34
@maribethb maribethb requested a review from BeksOmega June 15, 2023 18:34
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jun 15, 2023
@maribethb maribethb merged commit cb8ed73 into RaspberryPiFoundation:develop Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: disabling/enabling blocks not consitent

2 participants