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

fix: update disabled status after rendering #7172

Merged
merged 2 commits into from
Jun 15, 2023

Conversation

maribethb
Copy link
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 google: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