Underscore changes to Dash

Hi not sure if this is a bug or not as I can’t lock down the behaviour.
When I give a ID to a select item in some cases it changes an underscore “_” to a dash “-”.
It is not immediate, Blocs accepts the name then I move away and come back to find it has changed.
Other times it tells me the ID is already in use although it hasn’t been used.
This doesn’t occur for all selects in the page, just picks one or two and refuses to allow an underscore.
I noticed the behaviour in bloc2 and has continued in 3.
Annoying as I have javascript events coded to the name and then waste time debugging.

1 Like

I have the same issue! No takers?

Hi @andrewc & @Murgen,

To my knowledge Blocs currently does a few things. It changes ID’s and Class names to all lowercase vs allowing camelCase in case you happen to be trying to use that. It also does not see the difference between a hyphen and underscore and thinks it is the same and already in use (some-id / some_id). But does allow it for classes (someclass, some-class, some_class). So be mindful of the naming of ID selectors across your project until these issues are resolved. Naming conventions can be a topic unto themselves including various debates.

#bug Wish List - I think this was brought to the attention of @norm previously.

Is this behaviour by design or a bug?
I need to know as I have pages that have an underscore in the ID and no issue and no change.
This single page is changing all underscores to dashes.
I had a single ID in the page that had an underscore in the same page and it is ignored.
If I add a character to the ID name something parses the name and changes it to dash.
It affects how I will design the database attached to the project.

This recent thread maybe helpful

As far as I’m concerned this is a bug. I don’t like being forced by a software to do things, even if such naming conventions are standard practice. If I want to name an ID “MyAwesome_23” then that should be my right. In other software I have used you can turn these things on or off depending on how you work … “allow code correction” … “allow code hints” … etc.

And it’s especially time consuming and irritating when a software does rename things AND it does it “behind my back”.