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

Disabling only one field on a block #4932

Closed
jschanker opened this issue Jun 18, 2021 · 3 comments
Closed

Disabling only one field on a block #4932

jschanker opened this issue Jun 18, 2021 · 3 comments
Labels
component: fields issue: feature request Describes a new feature and why it should be added

Comments

@jschanker
Copy link
Contributor

jschanker commented Jun 18, 2021

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

@jschanker jschanker added issue: triage Issues awaiting triage by a Blockly team member issue: feature request Describes a new feature and why it should be added labels Jun 18, 2021
@moniika moniika added this to the Bug Bash Backlog milestone Jun 18, 2021
@moniika moniika added component: fields and removed issue: triage Issues awaiting triage by a Blockly team member labels Jun 18, 2021
jschanker added a commit to jschanker/blockly that referenced this issue Jun 20, 2021
jschanker added a commit to jschanker/blockly that referenced this issue Jun 20, 2021
* Fixed lint error (moved && to end of line and adjusted line breaks accordingly)
@jschanker
Copy link
Contributor Author

Stumbled upon duplicate #2763 while looking at the Icebox issues. Close this as duplicate?

@BeksOmega
Copy link
Collaborator

I think this one has more detail so I'm going to keep this one and close the other =) Plus this issue is already linked to your PR. I've added the forum link from that issue to this one. Thanks for finding the dupe!

maribethb pushed a commit that referenced this issue Jul 20, 2021
* Permit single field disabling (#4932)

* Permit single field disabling (#4932)

* Fixed lint error (moved && to end of line and adjusted line breaks accordingly)

* Added XML Field (De)Serialization

* Call parent method in FieldDropdown's fromXml
* Added protected helper methods to handle serialization/deserialization of enabled property/attribute of fields
* Minor changes to annotations to account for field disabling and 4 spaces per line break per style guide

* Revert "Added XML Field (De)Serialization"

This reverts commit 1964e86.

* Comment style changes

* Comment reversions

* Indentation fix

* Indentation reversion
@jschanker
Copy link
Contributor Author

Resolved by #4941.

moniika pushed a commit that referenced this issue Jul 20, 2021
* Permit single field disabling (#4932)

* Permit single field disabling (#4932)

* Fixed lint error (moved && to end of line and adjusted line breaks accordingly)

* Added XML Field (De)Serialization

* Call parent method in FieldDropdown's fromXml
* Added protected helper methods to handle serialization/deserialization of enabled property/attribute of fields
* Minor changes to annotations to account for field disabling and 4 spaces per line break per style guide

* Revert "Added XML Field (De)Serialization"

This reverts commit 1964e86.

* Comment style changes

* Comment reversions

* Indentation fix

* Indentation reversion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: fields issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

3 participants