Suggestion: Placeholder on Save Input block

A feature I’d like to see in Hopscotch is:

Placeholder on Save Input Block

I’d use it for this type of project:

Here are some examples of Hopscotch code that could be improved if we had this:

Here is an example design I’ve made:

image

I’ve seen something similar in another programming languages, it looks like this:

9 Likes

Shoutouts to the block rendering!

I second this, but with one change:

  • Parameter 2 = caption
  • Parameter 3 = placeholder

See this post:

Also, this goes for Set Text to Input as well, right?

2 Likes

Lol

1 Like

(@ArcadeGrounds)

3 Likes

Another suggestion:

1 Like

This is something I thought about as well! Along with being able to customize the title (or is this what you meant by placeholder), it would really improve the block!

2 Likes

wait what is a placeholder?

2 Likes

Something that goes in the bubble to add text before ypu type anything.


I feel like having it be fully selected text would make the most sense, since it allows easy copying and also can easily be added to or removed completely.

2 Likes

Might not be selected by default on iOS, but most browsers select all placeholder text.

1 Like

so basically like a comment on what to put there later? Interesting

3 Likes

Capture

3 Likes

That would be too confusing. Just add validation to the prompt using match regex.

^-?[0-9]*?\.?[0-9]+?$

1 Like

Yeah, tat wou,d be neat

2 Likes

I meant the parameter would be confusing.

I’d like to see an implementation of this using a separate block simply called “Save Number” that only allows number input.

2 Likes

Couldn’t you just have the save input in a custom block whihc calls itself and checks if it matches [\\+\-]\d*\\.\d+([eE][\\+\-]?\d+)? and if it doesn’t it asks for input again?

2 Likes

Of course :man_facepalming:t4: how dumb of me

2 Likes

Yes, you could. I posted that solution before (instead of “e” I only allowed decimals since Hopscotch probably would not accept 1e3 as a number but rather a string – idk does it work??) but having an integrated feature with “Save Number” would probably be a better solution.

1 Like

It does accept scientific notation, yes.

2 Likes

Oh that’s cool

I remember Chrome used to give that as feedback for invalid number fields but I couldn’t find it after that.

2 Likes

Oops. I had originally had it outside of the backticks but put them around it to avoid confusion with the last question mark.

3 Likes