Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×

Macro naming 'space' replacement

I've noticed that the code to replace spaces in macro names does not appear to work as intended. It's not completely broken behaviour, just a little frustrating :) Expected behaviour would be for a dash to appear anywhere I attempt to insert a space in a macro name. What actually happens is that the last character in the input is replaced. The reason this is a problem is that I often move the cursor elsewhere in the input when typing and am not actually typing at the end of the text. The following screenshots show what happens if i try to insert a space between 'Macro' and 'Name'. Obviously spaces are getting removed but the 'dash' adding behaviour must be happening separately.  I normally solve this sort of problem by grabbing the input value on keyup and just doing a character replacement and setting the value with the modified value.
1456574775
Ziechael
Forum Champion
Sheet Author
API Scripter
Thanks for flagging that Ed, i'm seeing the same behaviour and will escalate it for the attention of the Devs.
It's been that way since the beginning. I think I asked why once... but I've long since forgotten if I got an answer or what it might have been. Also about why we couldn't just have spaces like a normal input box.
HoneyBadger said: Also about why we couldn't just have spaces like a normal input box. The parser interprets white space as the end of a macro's name.