drawshield/Drawshield-Code

The alert for no blazon only triggers on completely empty textbox

Closed this issue · 2 comments

5ucur commented

The alert "Enter a blazon in the text box above", that pops up for an empty blazon, only happens if the textbox is fully empty, as opposed to when it's filled with just whitespace (e.g. empty lines, like by default). I suppose a solution would be using trim() on the blazon string and then checking if it's empty.

I'm reporting as I figure this is unintended behaviour. I personally prefer it as is (or was, since I never encountered the alert before, as I often clear the textbox and click draw to get an empty shield).

(I hope my issue reports aren't annoying; I want to help the project, and this is as much as I can do currently)

Please keep reporting things like this, they are always useful. Yes, it was something that I added recently (but not implemented properly!)

I get regular messages from the "Report this error" function with an empty blazon so I think that people are expecting the "Draw" button to start something. So the question is what should happen in that case - there didn't seem to be a lot of point contacting the server so I thought about the alert. Suggestions for other actions welcome (but in the meantime, yes, I'll trim the content first)

5ucur commented

Obviously, yeah, there's no point contacting the server when there's no input. For me personally the alert is annoying, but I trigger it twice intentionally, and then I "prevent the page from creating additional dialogs". No issue there.

It's probably the best solution for notifying most other users, on the other hand. It pops up above everything else and is very hard to miss. I suppose you could add a warning message near the textbox/button, if the user clicks the button - or something else like that - but I think the alert covers more bases.

And as for my practice of clearing the shield while playing around with the tool, I've found an alternative that works even with alerts - a blazon of just arg and then draw shield. Quick and works well enough!