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

block_svg: render isn't sync OK with the state after disable/enable ops #6988

Closed
1 task done
dimaaan21 opened this issue Apr 18, 2023 · 0 comments · Fixed by #6989
Closed
1 task done

block_svg: render isn't sync OK with the state after disable/enable ops #6988

dimaaan21 opened this issue Apr 18, 2023 · 0 comments · Fixed by #6989
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@dimaaan21
Copy link
Contributor

Check for duplicates

  • I have searched for similar issues before opening a new one.

Description

There is a render mistake after disable/enable operations: if there is a disabled block at some level, all blocks views below it will unsync with the state

Reproduction steps

  1. Open playground (https://blockly-demo.appspot.com/static/tests/playground.html)
  2. Paste in attached JSON to the textarea (or create hierarchy if => [repeat, for, whileUntil, forEach] manually)
  3. Click "Load"
  4. if-block: right-click => "Disable block"
  5. if-block: right-click => "Enable block"
  6. You'll see that blocks after for-block will be rendered as disabled but they're not (check JSON) – render bug
  7. Reload page. Click "Load" again. Everything is OK
{
  "blocks": {
    "languageVersion": 0,
    "blocks": [
      {
        "type": "controls_if",
        "id": "iB$?M1srl.oI.0f!0MJ6",
        "x": 13,
        "y": 13,
        "inputs": {
          "DO0": {
            "block": {
              "type": "controls_repeat_ext",
              "id": "IIi|I1fo%;+hBa-{~;t9",
              "inputs": {
                "TIMES": {
                  "shadow": {
                    "type": "math_number",
                    "id": "fD1HEU9xtQ.6#WWC7P=-",
                    "fields": {
                      "NUM": 10
                    }
                  }
                }
              },
              "next": {
                "block": {
                  "type": "controls_for",
                  "id": "Mg;C+1sKjF~dn1YOJVeV",
                  "enabled": false,
                  "fields": {
                    "VAR": {
                      "id": "[email protected],x,_Ihmy"
                    }
                  },
                  "inputs": {
                    "FROM": {
                      "shadow": {
                        "type": "math_number",
                        "id": "N4^C~zr1!^~:{:^Ih+pP",
                        "fields": {
                          "NUM": 1
                        }
                      }
                    },
                    "TO": {
                      "shadow": {
                        "type": "math_number",
                        "id": "^^ev;%@.D}86**fl_[bc",
                        "fields": {
                          "NUM": 10
                        }
                      }
                    },
                    "BY": {
                      "shadow": {
                        "type": "math_number",
                        "id": "(Xka3$h[8tN7N7eM@*?a",
                        "fields": {
                          "NUM": 1
                        }
                      }
                    }
                  },
                  "next": {
                    "block": {
                      "type": "controls_whileUntil",
                      "id": "yyv?|{xQx5O_AHI%Q1]|",
                      "fields": {
                        "MODE": "WHILE"
                      },
                      "next": {
                        "block": {
                          "type": "controls_forEach",
                          "id": "IpHhA{)YO*KPD:PR8[JZ",
                          "fields": {
                            "VAR": {
                              "id": "72HM7ixY8#C1g%Szp}F#"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    ]
  },
  "variables": [
    {
      "name": "i",
      "id": "[email protected],x,_Ihmy"
    },
    {
      "name": "j",
      "id": "72HM7ixY8#C1g%Szp}F#"
    }
  ]
}

Снимок экрана 2023-04-18 в 18 39 52

Снимок экрана 2023-04-18 в 18 39 39

Stack trace

No response

Screenshots

2023-04-18 18 39 22

2023-04-18 18 39 39

2023-04-18 18 39 52

2023-04-18 18 40 00

2023-04-18 18 40 08

Browsers

Chrome desktop, Safari desktop

@dimaaan21 dimaaan21 added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Apr 18, 2023
@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants