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

Modifying the structure of a block does not trigger widgets to be repositioned #7491

Closed
1 task done
maribethb opened this issue Sep 15, 2023 · 2 comments · Fixed by #7507
Closed
1 task done

Modifying the structure of a block does not trigger widgets to be repositioned #7491

maribethb opened this issue Sep 15, 2023 · 2 comments · Fixed by #7507
Assignees
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@maribethb
Copy link
Contributor

Check for duplicates

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

Description

If a warning icon is added or removed during field editing, the field is not rendered correctly.

related to the rendering queue and might be related to #7068 ?

Reproduction steps

  1. Open Block Factory
  2. Drag two value input blocks into the inputs input. Notice how they each have a warning now due to conflicting names.
  3. Change the name of one of the inputs. The warning disappears, and the underlying block is resized. But the text input html element is now in the wrong place because it did not move when the block was resized.
  4. Click outside the field to end editing / close the widget div.
  5. Change the name back to NAME. The warning reappears, causing the same problem again.

Stack trace

No response

Screenshots

Screenshot 2023-09-14 at 5 39 53 PM

Browsers

No response

@maribethb maribethb added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member and removed issue: triage Issues awaiting triage by a Blockly team member labels Sep 15, 2023
@BeksOmega
Copy link
Collaborator

Not related to render queueing. Repros back to at least 2020: https://20200123-dot-blockly-demo.appspot.com/static/demos/blockfactory/index.html

@BeksOmega
Copy link
Collaborator

Actual problem is that modifying the block does not trigger the widget div / widgets to reposition.

Alternative reproduction steps:

  1. Open the playground.
  2. Load the following JSON into the playground.
{
  "blocks": {
    "languageVersion": 0,
    "blocks": [
      {
        "type": "text"
      }
    ]
  }
}
  1. Click on the text input field.
  2. Run the following code in the browser console.
Blockly.getMainWorkspace().getTopBlocks()[0].getInput('').insertFieldAt(0, 'bump');
  1. Observe how the text input widget is mispositioned.
    image

Note that the originally reported issue could be fixed by using a validator instead of a change listener, so that the warning icon is added before the rerendering of the field (triggered by the field edit) is completed.

@BeksOmega BeksOmega changed the title warning rendering when warnings appear during field edits Modifying the structure of a block does not trigger widgets to be repositioned Sep 21, 2023
@BeksOmega BeksOmega mentioned this issue Sep 21, 2023
2 tasks
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