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

Enhance FieldDropdown's extendability #6349

Open
semiaddict opened this issue Aug 15, 2022 · 1 comment
Open

Enhance FieldDropdown's extendability #6349

semiaddict opened this issue Aug 15, 2022 · 1 comment
Labels
component: fields help wanted External contributions actively solicited issue: feature request Describes a new feature and why it should be added
Milestone

Comments

@semiaddict
Copy link

semiaddict commented Aug 15, 2022

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

I would like to extend the FieldDropdown class to allow disabled options.
I was hoping to be able to simply override the dropdownCreate_ function, to parse new option parameters in content as is done for image options, but it is currently very difficult to do so without copying most of the code as validateOptions is not a member of the class, so it cannot be adapted to take new parameters into consideration when validating the options.

Describe the solution you'd like

Move validateOptions to be a static function (possible private) of the FieldDropdown class.

Describe alternatives you've considered

The only alternative I can think of to achieve what I need at the moment is to copy the constructor and getOptions of the class into the new class.

Additional context

None.

@semiaddict semiaddict added the issue: triage Issues awaiting triage by a Blockly team member label Aug 15, 2022
@BeksOmega BeksOmega added issue: feature request Describes a new feature and why it should be added component: fields help wanted External contributions actively solicited and removed issue: triage Issues awaiting triage by a Blockly team member labels Aug 16, 2022
@rachel-fenichel rachel-fenichel added this to the Feature Fest milestone Oct 12, 2022
@semiaddict
Copy link
Author

semiaddict commented Nov 29, 2022

BTW, I am having the same difficulties now with isMenuGenerator, trimOptions and applyTrim when extending the FieldDropdown class.

It would be great to either add those as static methods, or export them to be able to use them directly in the extended class.

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

No branches or pull requests

3 participants