Create a dropdown menu in a custom block

Thanks! I was having trouble finding out how to make a submenu.

It also accepts JavaScript functions. For example:

function() {
  return Object.assign(
    {this: "this", ["~ "]: null},
    this.objectsMenu());
}

that could be too complex for this tutorial. (also have I seen you in scratch?)

I think it's still worth mentioning because it's required for more complex dropdowns.

Another thing that is not mentioned yet are separators, which can be added using ~.

how would those be helpful

If you want your menu to look nicer
image

foo
bar
baz

vs.
image

foo
~
bar
baz

I didn't know about that!

(also have I seen you in scratch?)

Yeah, I'm on Scratch too.

Thanks for this. It helped me a lot. :slight_smile:

:smirk:
https://snap.berkeley.edu/snap/snap.html#present:Username=snapenilk&ProjectName=tricky%20menu