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

Input.prototype.setVisible should not assume that this.connection is a RenderedConnection #8694

Open
1 task
kushichidota opened this issue Dec 11, 2024 · 0 comments
Assignees
Labels
issue: bug Describes why the code or behaviour is wrong

Comments

@kushichidota
Copy link

kushichidota commented Dec 11, 2024

[Bug report rewritten by @cpcallen.]

The setVisible method of Input does an unsafe cast this.connection as RenderedConnection. Instead, the actual type of this.connection should be tested an the method shoud no-op if the connection is not a RenderedConnection.

Original description follows.

Check for duplicates

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

Description

It is not possible to activate the toolbox search bar and hide a input parameter of a block.

Within the function where my block and its inputfields get initialized i try to hide some inputfields with the method setVisible(false). But unfortunately this will cause an error.

The weird thing about that is, that this bug only occurs when the toolbox search bar is activated.

Reproduction steps

Error occurs during the initialization of a block and its fields.

An example of my code:

Blockly.Blocks['customBlockName'] = {
init: function (this: Blockly.Block) {
this.appendDummyInput().appendField('customBlockName');

/*
bunch of code
.......
......
.....
*/

const inputField: Blockly.Input = this.appendValueInput('inputFieldIdInput').setCheck('String').appendField('inputFieldId')

customAddBlockService.appendshadowBlock()

inputField.setVisible(fallse) // --> This line of code will cuase an error

Stack trace

Screenshots

Image

Browsers

No response

@kushichidota kushichidota added issue: bug Describes why the code or behaviour is wrong issue: triage Issues awaiting triage by a Blockly team member labels Dec 11, 2024
@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Dec 13, 2024
@cpcallen cpcallen changed the title Not able to use setVisible() method with false as argument on a variable of type "Blockly.Input" when toolbox is activated Input.prototype.setVisible should not assume that this.connection is a RenderedConnection Dec 13, 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

No branches or pull requests

3 participants