Can Not Type
A Space Character

May 19

A good sign that a feature is never used is when it has a bug in it for years and no one comes across it. This happened to me just recently.

The Sitefinity Module Builder provides a lot of configuration options but to access them you need to drill down into the configuration tree.

The Bug

After upgrading to 12.2 my client raised a bug that they could not add a space character at the end of a long field input of a dynamic module when typing. What they had to do was type a character then backspace into the sentence and type as normal finally deleting the excess character at the end when they were finished.

When I investigated I found the same issue but it only applied to fields where I had the maximum characters limit set. You can see how to do this from the Sitefinity documentation - Add character counter. This is a helpful option. Often I use it to create a long text field where I want the content editor to enter a paragraph of text for a section of the site but the design calls for it to not exceed a certain size. I set the interface to be a TextArea element rather than the Html editor option and the text is often injected inside of some HTML such as a with a class attribute.

Trim Spaces Option

But you will also notice there is the option to "Trim Spaces". Sounds like a good idea. I don't want any trailing spaces accidentally left by the content editor. But it turns out that if you have both the 'Max limit' and 'Trim Spaces' set then the UI will prevent you from typing a space character at the end of the text. My self, I assumed that, trimming spaces would occur as the field is saved as opposed to while I was typing.

In the end this was not a 12.2 upgrade bug. It was also an issue in our projects previous version and according to Sitefinity that code had been around for ever. They have logged a bug for it so it will be fixed in time.

Did you know where the term 'bug' came from?

Back in the punch card days of computers an actual bug would get into the cards, get squashed and interfere with the running of the program. Thus, a computer bug. Thomas Edison, also started the phase citing there was a bug in his telephones causing them not not function. But he meant literally, bugs were entering and living in the telephones and causing problems.


Darrin Robertson - Sitefinity Developer

Thanks for reading and feel free to comment - Darrin Robertson

If I was really helpful and you would buy me a coffee if you could, yay! You can.


Leave a comment
Load more comments

Make a Comment

recapcha code