šŸ”„ Classify 4: A tiny plugin that brings CSS classes and +

It’s very specific, overflow updates will also not work. I think it has to do with how Bubble applies inline styles during render. Classify updates probably get overidden.

I think I see why

This is what I have


buttonsGroup {style: "position: sticky; bottom: 0px;"}

@julienallard1 if you republish the plugin without obsfucating it, I would take a look at the code and try to help.

@rico.trevisan @ihsanzainal84

Hey guys, I just pushed a new update that should fix these issues. In some cases, the algorithm that parses the content of the ID field into classify commands would mess up.

From the little testing I did, it all seems to work fine. Please let me know how it goes for you :+1:

Thanks to Arron from Levupp, a little bug introduced in previous update was fixed:

The algorithm that parsed raw commands would throw an error when a command (addClass, style, attribute, etc…) and the colon that follow would be separated by a space.
Now both of these examples are valid:

  • {addClass: "myClass"}
  • {addClass : "myClass"}

You are invited to update to version 4.0.8

Classify just saved my butt with per-question radio button spacing on a form. Thanks for developing this plugin and offering it for free!

hey, thanks for taking the time to mention on the forum, I appreciate it!

Classify has now been around for over 6 years and currently installed on 90K+ apps. I would’ve really liked the Bubble Team to acknowledge the need for easier CSS controls and implement a native solution…

hey all! I just released an update that fixed a bug where, in some cases, some Classify commands could throw an exception when content was still loading on page. Thanks to Akihito Ktakatsu for reporting the issue :flexed_biceps: .

While at it, I added a new little function that allows Classify to log informations (errors, warnings and standard messages) into an object you can access in the browser’s console by typing classifyLogs. This logging feature is enabled only when running your bubble app in preview mode.

Happy new year everyone!

Hey @julienallard1 I just discovered a bug with tempclass. If the main ID Attribute does not call any Classify method but then calls tempclass in the condition, the tempclass will not get removed from the element.

Main ID Attribute Condition ID Attribute Works as intended? Issue
someElementID someElementID{tempClass: ā€œpopFrontā€} :cross_mark: Temp class sticks
someElementID{} someElementID{tempClass: ā€œpopFrontā€} :white_check_mark:
someElementID{tempClass: ā€œpopFrontā€} :cross_mark: Temp class sticks
{} someElementID{tempClass: ā€œpopFrontā€} :white_check_mark:

As a test I assumed Classify will trigger a checking function if I added the encapsulation and it worked. So as long as Classify is called in the main ID Attribute, the TempClass will remove correctly.

I assume that this issue is persistent for other Classify methods that only get called in a condition cause I do remember Classify script methods failing many moons ago, when I was testing if I can trigger some scripts in conditions.

Hope a fix is not too much trouble!

Thanks for pointing that out. I’ll try to spare some time in the near future to have a look at it.

@ihsanzainal84 I just publish an update that addresses the issue. Thanks for reporting it :+1:

Hey all, version 4.1.1 is out. This update only contains a bug fix

:warning: Because of my very limited time and because I don’t use Bubble anymore, only minimal testing were made, prior releasing this update.

So if version 4.1.0 didn’t cause you any issue, consider not updating…

ah… thank you for your post!
I was trying to figure out why my where nolonger working, being applied, messing my website ->Indeed 4.1.1. gives breaks my html styles linked to ID attributes . Revearting back to 4.1.0 works for me.

@fdirkzwager Can you provide further explanations? Does the breaking occurs because you had worked around the bug that was fixed in 4.1.1 or is it something different?

@julienallard1 send you a message with more details.

Hi,
I am very interested in your post.
I’d like to discuss this in more detail.
Thanks

And now version 4.1.2 is out, fixing a major bug I introduced in previous release.

Obviously, this happened because I only ran minimal testing and I don’t use Bubble. Thanks to @fdirkzwager for reporting the issue.

:warning: Again, because of my very limited time and because I don’t use Bubble anymore, only minimal testing were made, prior releasing this update. If you’re still on version 4.1.0 and it works fine, you can remain with that version.

Hello all,

Is there are a way to handle apostrophes when setting an attribute’s value? For example, I’m attempting to set an element’s aria-label attribute and when I include an apostrophe in the label’s value the aria-label attribute is not added to the DOM.

I’ve tried

  • Escaping the apostrophe (\'): Results in a single, double quote being included in place of the apostrophe

  • Encapsulating the apostrophe in single quotes ('''): aria-label attribute isn’t added to the DOM

  • Encapsulating the HTML representation in single quotes ('''): aria-label attribute isn’t added to the dom

  • The raw HTML representation ('): aria-label’s value includes the raw HTML representation instead of an apostrophe

  • A backtick in place of the apostrophe (`): aria-label’s value includes the backtick

Edit: This was resolved by upgrading the plugin to version 4.1.0. Leaving this post for future reference. Let me know if I should delete it.

And a follow up request. I’m unable to apply multiple attributes, consisting of aria-disabled and tabindex to a single element. I’ve review the documentation, which gives an example of providing multiple attributes in a single object.

My attempts have included,

  • { attribute: "tabindex=-1", attribute: "aria-disabled=true" }: only applies tabindex = -1 to the DOM element
  • {attribute: "tabindex=-1", attribute: "aria-disabled=trueā€}: only applies aria-disabled=true to the DOM element
  • { attribute: "tabindex=-1" } ( attribute: "aria-disabled=true" }: only applies tabindex=-1 to the DOM element
  • {attribute: "tabindex=-1", "aria-disabled=true"}: doesn’t apply any of the attributes to the DOM element
  • {attribute: "tabindex=-1 aria-disabled=true"}: applies tabindex=ā€œ-1 aria-disabled=trueā€ to the DOM element

Any assistance with sorting this out would be appreciated.

Edit: This was resolved by upgrading the plugin to version 4.1.0. Leaving this post for future reference. Let me know if I should delete it.

hey @joe30 ,

I just ran a quick test and this worked perfectly on version 4.1.2:
{attribute: "aria-label=hey 'bob' !", attribute: "title=hey 'bob' !"}

  • Both attribute commands were applied to the element
  • The text was correctly parsed, including the apostrophes

Perhaps something in you dynamic value breaks the syntax?

Hello and thanks for following up, @julienallard1.

I mentioned in the edit of my last post that upgrading the plugin to v4.1.0 resolved the issues for me. Let me know if you’d like me to delete my previous posts or leave them as a reference.