Space in String Assignment Removed By Wappler

======== TEMPLATE BUG FORM ========

Wappler Version: 3.5.5
Operating System: Windows 10

Expected behavior

What do you think should happen?

If I assign a string to a value, I should be able to end that string with a space character.

Actual behavior

What actually happens?

Wappler deletes the space character.

How to reproduce

See Video attached.

What if you add the space in the text input, where you enter the text and not in the code view? You just enter your text there and you can also pick dynamic data there as well … no need to open the code view and enter text when you are supposed to just enter it in the input:

Screenshot_34

Yes, I found that this works okay… thank you @Teodor.

I still consider it a bug that Wappler deletes the one I have added in the code view though!

Perhaps Wappler assumes you would never want to include a space at the end of variable, any more than you would want to store a value in a database with a trailing space. I think it would be a reasonable assumption.

I can’t say I agree with that… I think Wappler users are very capable of deciding where they want a space character and expecting Wappler to obey their wishes! :slight_smile:

I’m with Tom on this…it is very common to trim white space from the ends of values to prevent issues especially common with copy/paste. The space cannot be seen and therefore becomes a nightmare to troubleshoot.

Antony’s use case remains equally valid though.

Perhaps the editor can incorporate both of these into validation. Something like trim the ends of white space, unless the user has actually hit the space key during entry?

Well the issue here is that if you add the white space as you type the Set Value’s value here, it remains:

here1

But if you click on the lightning button, it is automatically removed for you, just by clicking on the lightning button!

here2

So Wappler feels very inconsistent, and is removing something via one editing mechanism that it had allowed in another!

Ya, I’m not saying this can’t be improved, only agreeing with Tom that we should not ignore the use cases other than yours. :slight_smile: It’s above my paygrade to find the solution.

Looking at the issue and the current solution, I do agree with you to some extent. Using the method that @Teodor suggested, I think it would be better if trailing spaces were automatically removed. I wouldn’t use this method; it’s a sort of workaround for an issue that isn’t much of an issue. :slightly_smiling_face: Also, at some point, it’s possible that Wappler will be changed, so spaces are trimmed in this situation - so people won’t rely on spaces they can’t ‘see’ - which would break the workaround.

On the other hand, if I enclosed a string in quotes, I would expect trailing spaces to be retained. However, there are alternative approaches which means I would probably never have noticed that they weren’t, at least in this situation. Perhaps it’s more of a buglet than a bug. .

or

Choose your

3 Likes

Ride the Lightning all day! The Call of Ktulu is insane (as with most of the rest of the tracks)

1 Like

Plus I think it sounds better as a ‘lightning’ button :grin:

1 Like

My last two posts have attracted images of horses in a field and now heavy metal bands.

Am delighted to see the breadth of interests I seem to bring to the surface! :rofl:

2 Likes

What is it usually called then? :thinking:

Bolt usually.
But we are ok with lightning as long as you are riding it.

:metal:t2::guitar:

1 Like

Sound of the drums
Beating in my heart
The thunder of guns
Tore me apart

RIP Malcolm.

2 Likes

Okay, all fun content apart now…

I’ve just found that putting a space on the end of a string here:

here1

Results in the space being retained when you click in the Set Value Properties area to check it is there, but removed after the Server Action is saved! :exploding_head:

So @teodor, @george, how on earth in Wappler can I define a string with a space at the end?

I’m sure in any other language you can say:

my_string = 'A phrase ';

And your editor won’t delete the space either immediate, or sneakily when you do a file save!

This has been fixed in Wappler 4.6