# Problem with expandable arguments + an enum picker in custom block

**URL:** <https://forum.makecode.com/t/problem-with-expandable-arguments-an-enum-picker-in-custom-block/1732>\
**Category:** Help\
**Created:** [April 17, 2020, 11:17pm UTC](https://forum.makecode.com/t/problem-with-expandable-arguments-an-enum-picker-in-custom-block/1732 "2020-04-17T23:17:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [April 17, 2020, 11:17pm UTC](https://forum.makecode.com/t/problem-with-expandable-arguments-an-enum-picker-in-custom-block/1732/1 "2020-04-17T23:17:43Z")

</div>

I’m playing around with making some custom blocks, and I’m running into an issue with [expandable arguments](https://makecode.com/defining-blocks#expandable-arguments) coupled with an [enum picker](https://makecode.com/defining-blocks#enums).

Everything seems to work fine with either feature (my function with expandable arguments but no enum parameter OR my function with an enum picker but no expandable arguments). But when I use them in combination the block breaks (gets stuck to the cursor; can’t be trashed) when I interact with the + expander.

Here’s my `custom.ts`—if it’d be better to publish a project I could do that too.

```auto
enum Anchor {
    //% block="top left"
    TopLeft,
    //% block="bottom right"
    BottomRight,
}

namespace inputs {
    //% block="show a simple menu with %options||anchor %anchor foreground %foreground background %background"
    //% expandableArgumentMode=toggle
    //% anchor.defl=TopLeft
    //% foreground.shadow=colorindexpicker
    //% foreground.defl=1
    //% background.shadow=colorindexpicker
    //% background.defl=15
    export function showSimpleOptionMenu(options: string[], anchor: Anchor, foreground: number, background: number) {
        return 0; // index of selected option
    }
}

```

Am I doing something wrong? Thanks!

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [April 17, 2020, 11:56pm UTC](https://forum.makecode.com/t/problem-with-expandable-arguments-an-enum-picker-in-custom-block/1732/2 "2020-04-17T23:56:51Z")

</div>

Nope, your authoring is fine, just a bug in the blocks rendering (block sticking to cursor is almost a guaranteed uncaught exception in blockly). Just tested in beta and the updates fixed it, so this will be fixed in the next release 🙂

---

<div class="post-metadata">

**Author:** ![jacob\_c](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jacob_c/32/1532_2.png) [@jacob\_c](https://forum.makecode.com/u/jacob_c)\
**Post date:** [April 17, 2020, 11:58pm UTC](https://forum.makecode.com/t/problem-with-expandable-arguments-an-enum-picker-in-custom-block/1732/3 "2020-04-17T23:58:27Z")

</div>

Thanks!

I’ll avoid this combination of features until the next release.
