textbox-autoheight#1009
Conversation
| default_value: str = "", | ||
| *, | ||
| lines: int = 1, | ||
| max_lines: int = 100, |
There was a problem hiding this comment.
How about we leave max_lines as None by default, which allows the Textbox to get arbitrarily large. And set its type to be Optional[int]
There was a problem hiding this comment.
I had the same intention, my arbitrarily large number was 100, what is your arbitrarily large number? Frontend will have its own max value, so we can give a default value of arbitrarily large number.
There was a problem hiding this comment.
Why does there need to be a max value set in the frontend? I would set the default for max_lines to be None, meaning that there is no max -- the textbox just keeps getting longer.
There was a problem hiding this comment.
I think allowing the textbox to grow infinitely large is a poor default, we can easily set a default in the frontend though without there being one in the back.
There was a problem hiding this comment.
What about allowing 1 million max_lines if the user prefers. I think we would have a max for that as well right?
There was a problem hiding this comment.
Btw this design assigns a max value(100) when the user does not specify it, we could increase it if we wish. I don't see a need for passing None to frontend and frontend selecting that max value.
There was a problem hiding this comment.
Yeah, if we are going to set one in the frontend, we should make it consistent in the backend (and allow a user to override it to be much larger if they want). 100 is fine as a default, I suppose?
Edit: thinking from a UX perspective, I actually feel it should be less than 100. 20?
There was a problem hiding this comment.
@farukozderim We dont' need to pass anything to the front end particularly, the absence of any preference can trigger a default. I don't think UX defaults should live in the python library particularly.
20 is a better default. We don't want to a hard maximum because people may want longer 'prose'.
|
Looks good, see my comment above -- note that we will also need to fix a bunch of tests that currently test the config produced by the Textbox |
- add max-lines to textbox
- reformat
- add demo
- tweaks on scripts
- fix tests
- fix tests
- fix tests
- convert default max_height from 100 to 20
- convert default max_height from 100 to 20
ca380ce to
42adfa2
Compare
Backend side of #980