Forum Academy Marketplace Showcase Pricing Features

How can I see what kind an element is?

It seems like this must be simple, but there are times I’m looking at an element and its property sheet and cannot determine what kind of element it is.

The two categories that come to mind are these:

  • Input vs. Multiline Input

  • Icon vs. Ionic Icon

For instance, here I have an Icon element:
image

or is it an Ionic Icon? From looking at the property sheet, I don’t see that the kind of element is explicitly named. Is it there and I’m just not seeing it?

4 Likes

I don’t think there is a simple quick way to know this. I always include the element type in it’s name to recognize them.

Example of names:

  • Group = “User Info (grp)”
  • Dropdown = “User Info (drpdn)”
  • Image = “User thumbnail (img)”

The only other way, which isn’t practical is to create a condition where you can get the element’s type in the condition:

4 Likes

Thanks, @julienallard1.

I appreciate the tip of using a conditional to pick up the element type. It is probably all I need for my purposes.

I always name elements with a prefix of its functional type in lowercase, e.g. inputName or iconCheckDone. The prefix tells me the functional type, not the specific type. “input” is a text input element regardless of whether it’s a multi-line input. “icon” is an icon regardless of whether it is “ionic”, “material” or any other variant. The main value of this naming is to support readability of the code. It’s a twenty-plus-year habit and it’s served me well.

In a “code” language, you would always be able to determine the specific type by its declaration, therefore it isn’t necessary to be gnat’s-ass specific about the type. Input is input, icon is icon, and that’s all I need to know to understand program logic. Normally.

Bubble hides (or obscures) that information. The property sheet for an element is effectively its declaration but it doesn’t expose the specific type.

Since Bubble is a strongly typed language, it seem that it should be very easy to determine exactly what type an element is regardless of its name.

4 Likes

Very helpful tip, thanks.
I wish bubble let us to know info without such hack.