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

Hidden fields shouldn't have in-row spacing #8790

Closed
1 task done
alexcui03 opened this issue Mar 1, 2025 · 1 comment
Closed
1 task done

Hidden fields shouldn't have in-row spacing #8790

alexcui03 opened this issue Mar 1, 2025 · 1 comment
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@alexcui03
Copy link

alexcui03 commented Mar 1, 2025

Check for duplicates

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

Description

Example:
The above block has a hidden field '+', and that field in the below block is visible.
Image

The above block has an extra in-row spacing after the hidden field. According to RenderInfo.getInRowSpacing_ and RenderInfo.addElemSpacing_, the renderer will always create a spacer whether the field is visible or not. The expected behavior should be that there's only one spacing between two visible fields.

A possible solution is to add/remove fields instead of setting the visibility of fields. Since hidden fields also have some other rendering bugs (like #3223), maybe the visibility of fields should be deprecated?

Reproduction steps

  1. Create a block with a hidden field.

Stack trace

Screenshots

No response

Browsers

No response

@alexcui03 alexcui03 added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Mar 1, 2025
@maribethb
Copy link
Contributor

Hi @alexcui03, thanks for filing this issue. We do not generally support the idea of "hidden" fields in uncollapsed blocks, as noted in the other issue you linked. The correct implementation would be to add and remove the field as part of a mutator instead. Please post in our forum if you need additional assistance implementing this.

The setVisible method you are probably using is marked @internal in the code and it doesn't appear in our reference documentation. Anything marked @internal is generally not part of our public API and may be removed or changed without warning, so it's in your best interest to avoid using it.

Thanks, and let us know if you have additional questions.

@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Mar 7, 2025
@cpcallen cpcallen closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2025
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

No branches or pull requests

3 participants