fix: block_svg disable/enable ops lead to unsync state and render (#6989)

* fix: disable/enable block_svg downstream blocks

* fix: disable/enable block_svg improve
This commit is contained in:
Dima
2023-04-19 18:11:21 +03:00
committed by GitHub
parent 83e3dcac70
commit acd046e4b3

View File

@@ -947,7 +947,12 @@ export class BlockSvg extends Block implements IASTNodeLocationSvg,
*/
updateDisabled() {
const disabled = !this.isEnabled() || this.getInheritedDisabled();
if (this.visuallyDisabled === disabled) return;
if (this.visuallyDisabled === disabled) {
this.getNextBlock()?.updateDisabled();
return;
}
this.applyColour();
this.visuallyDisabled = disabled;
for (const child of this.getChildren(false)) {