I'm looking for a way of constructing a multi-line InputField
in a cloud notebook. That is, a text field that supports the following five behaviors:
- The 'Enter' key should make a new line
- Anywhere you click within it, the
InputField
will begin editing - Anywhere you mouseover the
InputField
, the mouse changes to a cursor - The 'Tab' key should make a new tab indent
- The
InputField
rectangle should be resizeable
Is there any workaround to get at least the first two desired properties above in a cloud notebook?
What I've tried:
In (desktop) Mathematica, you can hack around InputField
to get the newline-return behavior as described in this post:
For example, here's one way to do it:
text = ""; EventHandler[
InputField[ Dynamic @ text, String, ContinuousAction -> True, ImageSize->{300,100}],
{"ReturnKeyDown" :> Paste["\n"]}
]
I have tried all of the workarounds in the link, and each one fails in a Cloud notebook.
InputField["", String, ImageSize -> {450, 350}, FieldHint -> StringRiffle[Table[".",3000]," "]]
-- but this only works when you have no content in the input field yet. $\endgroup$