question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removing labels from buttons and only using icons

See original GitHub issue

I’m wondering if it’s possible to display only the icons as and not the text as specified in the original icon issue, for creating and removing object and array entries.

Currently the JSON below will generate the following buttons:

image

I can either get:

  • The name of the category
  • Blank for add, but not delete by setting category to " "
  • “item” used for the category if I don’t specify anything.

There is no specific wrapper on the text so I can’t hide just that and setting the font-size: 0 will also kill the font awesome icon.

Am I missing a basic configuration option here, any ideas how to best go about doing this?

{
      disable_properties: true,
      disable_collapse: true,
      disable_edit_json: true,
      theme: "bootstrap3",
      iconlib: "fontawesome4",
      schema: {
        type: "array",
        title: "categories",
        items: {
          type: "object",
          title: "category level 1",
          properties: {
            "Category 1": {
              type: "string",
              enum: ["Fill me"]
            },
            category2: {
              type: "array",
              // title: "category 2",
              items: {
                type: "object",
                title: " ",
                properties: {
                  "Category 2": {
                    type: "string",
                    enum: ["Fill me"]
                  },
                  "Category 3": {
                    type: "array",
                    title: "Category 3",
                    items: {
                      "Category 2": {
                        type: "string",
                        enum: ["Fill me"]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  );
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:18

github_iconTop GitHub Comments

1reaction
pmk65commented, Jan 16, 2019

Made a patch with span tags and it seems to be working perfectly. 😃 But the json-editor-btn- class is based on the iconlib key, so it might not be specific enough to style individual buttons. Especially the Array/Table “Delete” and “Delete All” buttons, which have the same icon/class name. There’s probably more, so if you got any ideas/suggestions let me know. I’ll then add some custom class names to those buttons.

1reaction
pmk65commented, Jan 15, 2019

Only one I can think of is that the HTML is always created for both icon and label, so the output will be a little bit larger due to the span tags.

The 3rd example will only work on Bootstrap themes, so we might want to introduce 1 or more extra “json-editor-btn-*” class names (Must be set regardless of theme). That way we can group buttons of same “type”.

The function that toggles button states like Expand/Collapse might need to be updated to be able to insert the correct text inside the span tags.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Introducing navigation icons with labels, then removing them
Only in the case a set of icons belong to a convention (and this discern has to be done carefully) it might be...
Read more >
How To Remove App Icon Labels/Names! EASY on ANY ...
Hey guys, hope you enjoyed the quick little tutorial on how to get a cleaaaaaner step on your android device.
Read more >
How do I remove titles from Windows 10 taskbar and keep ...
Right click on the taskbar and select Properties. Where it says Taskbar buttons, you want to set it to Always combine, hide labels....
Read more >
How to Remove Text from Icons in the Windows Taskbar
In this article, I'll show you how to remove the text in taskbar icons so that it only shows the icons and takes...
Read more >
How can I remove label from bottom navigation bar in flutter so ...
However this will remove all the labels, but i only want to remove the label of the add button. If I just use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found