Skip to content

Commit

Permalink
Improve documentation on TextAreaInput (#6264)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahuang11 authored and philippjfr committed Jan 24, 2024
1 parent 4702ab5 commit 00f0b8d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
18 changes: 17 additions & 1 deletion examples/reference/widgets/TextAreaInput.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"* **`name`** (str): The title of the widget\n",
"* **`placeholder`** (str): A placeholder string displayed when no value is entered\n",
"* **`rows`** (int, default=2): The number of rows in the text input field. \n",
"* **`resizable`** (boolean | str): Whether the layout is interactively resizable, and if so in which dimensions: `width`, `height`, or `both`.\n",
"* **`resizable`** (boolean | str, default='both'): Whether the layout is interactively resizable, and if so in which dimensions: `width`, `height`, or `both`.\n",
"\n",
"___"
]
Expand Down Expand Up @@ -94,6 +94,22 @@
"\"\"\", width=500)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"If you only want the text area to be resizable in the vertical direction, you can set the resizeable parameter to 'height':"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"pn.widgets.TextAreaInput(name=\"Vertical Adjustable TextArea\", resizable=\"height\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
6 changes: 4 additions & 2 deletions panel/widgets/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,11 @@ class TextAreaInput(TextInput):
rows = param.Integer(default=2, doc="""
Number of rows in the text input field.""")

resizable = param.ObjectSelector(objects=["both", "width", "height", False], doc="""
resizable = param.ObjectSelector(
objects=["both", "width", "height", False], doc="""
Whether the layout is interactively resizable,
and if so in which dimensions: `width`, `height`, or `both`.""")
and if so in which dimensions: `width`, `height`, or `both`.
Can only be set during initialization.""")

_widget_type: ClassVar[Type[Model]] = _bkTextAreaInput

Expand Down

0 comments on commit 00f0b8d

Please sign in to comment.