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

Blocks for adding elements to array #249

Open
aolney opened this issue Feb 14, 2019 · 0 comments
Open

Blocks for adding elements to array #249

aolney opened this issue Feb 14, 2019 · 0 comments

Comments

@aolney
Copy link

aolney commented Feb 14, 2019

I'm using a custom blocks palette and have a block for an array of objects (ELIZA rules):

rules = 
  [ 
    { pattern: /(.*)you remember(.*)/, position: 2, response: 'Do you often think of #'}
  ]

Pedagogically I'd like to give this block as an example and then another block with a rule template:

{ pattern: /``/, position: ``, response: ``}

The problem is that although I can make this block appear in the palette, it does not have a "notch" and so will not drag/drop into the correct insertion point in the rules array. This block instead is a a "flat" block typical of parameters.

I have a work around for this which is to use an IIFE, but pedagogically that is not so nice:

do -> return { pattern: /``/, position: ``, response: ``}

This drag/drops with the desired behavior.

It seems obvious this is a UI issue, so if there is a way of forcing notches from the palette itself, I could solve the problem that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant