Problem with Implementing Toolbox Search in Blockly

30 views
Skip to first unread message

Φοίβος Προεστάκης

unread,
Jul 15, 2024, 1:26:40 PM (7 days ago) Jul 15
to Blockly

I am reaching out to seek assistance with an issue I am encountering while trying to implement the toolbox search functionality in our Blockly project. Despite following the documentation and making necessary changes, the search feature does not seem to work as expected.The problem arises when I try to add the search kind to the toolbox. According to the official documentation, the kind for the search should be search. However, when I use kind: 'search' for the search, it does not function as intended. If I change the kind to 'category', the feature still does not work, and the console does not show any errors to help diagnose the issue.

Here is the code snippet that I am currently working with:

const toolboxCategories = {
  kind: 'categoryToolbox',
  contents: [
    {
      kind: 'category',
      name: 'Text Processing',
      colour: '#4CAF50',
      contents: [
        { kind: 'block', type: 'head' },
...
 ]
},
{
  kind: 'search',
  name: 'search',
  contents: []
  ]
};

I would greatly appreciate any guidance or suggestions on how to properly implement the search functionality within the toolbox. Specifically, I need help understanding the correct way to define and integrate the search category so that it works seamlessly with the other toolbox categories.

Thank you for your time and assistance. I look forward to your response.

Best regards, Foivos Proestakis

Beka Westberg

unread,
Jul 15, 2024, 4:44:28 PM (7 days ago) Jul 15
to blo...@googlegroups.com
Hello Foivos,

Just to check, are you also installing the plugin and adding the import to your script file? Here are the docs I'm looking at for reference.

It also looks like you might be including the toolbox category at the wrong level. It should go inside the `contents` array. Could you try moving it and see if that work?

Hopefully with a bit more information we can get this sorted!
--Beka

--
You received this message because you are subscribed to the Google Groups "Blockly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blockly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/blockly/e1657c20-b9c3-43ba-8e0c-65251a03ef23n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages