Skip to content

Disabling only one field on a block #4932

@jschanker

Description

@jschanker

Is your feature request related to a problem? Please describe.

While you can disable all fields on a block by calling setEditable on it, there doesn't appear to be a method to disable only one of its fields.

Describe the solution you'd like

Introduce a setEnabled method for fields so you can toggle whether the editor will display or not.

Describe alternatives you've considered

  • Have the user extend a Field subclass to provide this method manually for the specific type of field he/she wants to have the ability to disable. Not good for overriding multiple types of Fields.

Additional context

Related to the question in the post on the Blockly forum here: https://groups.google.com/g/blockly/c/tnWc8-WM1lk

[Beka] And this topic as well: https://groups.google.com/d/msg/blockly/OiUL3gzGATQ/WUadyexeBwAJ

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions