blockly-samples icon indicating copy to clipboard operation
blockly-samples copied to clipboard

Combobox field

Open samelhusseini opened this issue 6 years ago • 2 comments

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

A combo box field.

Describe the solution you'd like

A field that has both a text / number input, and a dropdown of options allowing developers to choose a set of options to display to users.

Additional context

Something like this: Screen Shot 2020-04-08 at 2 57 44 PM

Think about

  • What will the API look like?
  • Can we extend core blockly fields to achieve this.
  • What will accessibility look like. https://www.w3.org/TR/wai-aria-practices/examples/combobox/aria1.1pattern/listbox-combo.html
  • On a related note, how do we handle focus between the two?

samelhusseini avatar Apr 08 '20 21:04 samelhusseini

This feature is available on Blockly?

fewiki avatar Apr 07 '21 08:04 fewiki

Here is some more information on how to get started on this issue:

  • The specific field mentioned in this issue can be found in the Basic toolbox category on the Microbit Makecode site if you would like to play around with it.
  • More information on creating custom fields can be found in the blockly developer guides.
  • More information on getting started implementing a plugin can be found on the blockly samples wiki

One of the main difficulties with this field is that it combines major functionality from two of our internal fields. This is an issue because we are only able to extend one of these fields. MakeCode got around this issue by adding a reference to some of the necessary methods from the field they were not extending. However, all of these values they are using are private. If we decide to go down this pathway, we would need to make these public before we are able to use them in samples.

The other option Christopher mentioned was to try to pull out the dropdown part of the field, so that both the field-dropdown and the field-combobox could then create dropdown instances. I looked into this a bit. I think it is possible, and not as difficult as I originally thought, but part of this issue would be to dig a little deeper into this and see if it is actually possible and what the pros/cons are.

alschmiedt avatar Feb 16 '22 00:02 alschmiedt