@@ -1081,7 +1081,7 @@ def put_collapse(title, content=[], open=False, scope=None, position=OutputPosit
10811081
10821082
10831083@safely_destruct_output_when_exp ('content' )
1084- def put_scrollable (content = [], height = 400 , keep_bottom = False , horizon_scroll = False , border = True ,
1084+ def put_scrollable (content = [], height = 400 , keep_bottom = False , border = True ,
10851085 scope = None , position = OutputPosition .BOTTOM , ** kwargs ) -> Output :
10861086 """Output a fixed height content area. scroll bar is displayed when the content exceeds the limit
10871087
@@ -1090,8 +1090,8 @@ def put_scrollable(content=[], height=400, keep_bottom=False, horizon_scroll=Fal
10901090 :param int/tuple height: The height of the area (in pixels).
10911091 ``height`` parameter also accepts ``(min_height, max_height)`` to indicate the range of height, for example,
10921092 ``(100, 200)`` means that the area has a minimum height of 100 pixels and a maximum of 200 pixels.
1093+ Set ``None`` if you don't want to limit the height
10931094 :param bool keep_bottom: Whether to keep the content area scrolled to the bottom when updated.
1094- :param bool horizon_scroll: Whether to use the horizontal scroll bar
10951095 :param bool border: Whether to show border
10961096 :param int scope, position: Those arguments have the same meaning as for `put_text()`
10971097
@@ -1110,9 +1110,22 @@ def put_scrollable(content=[], height=400, keep_bottom=False, horizon_scroll=Fal
11101110 o.append(time.time())
11111111 time.sleep(0.5)
11121112
1113+ You can use `put_scrollable()` to avoid page width exceeding screen width (especially in mobile device):
1114+
1115+ .. exportable-codeblock::
1116+ :name: put_scrollable_2
1117+ :summary: `put_scrollable()` usage
1118+
1119+ with put_scrollable(border=False, height=None):
1120+ # use `white-space: nowrap` to disable line break
1121+ put_text('long content ' * 20).style('white-space: nowrap')
1122+
11131123 .. versionchanged:: 1.1
11141124 add ``height`` parameter,remove ``max_height`` parameter;
11151125 add ``keep_bottom`` parameter
1126+
1127+ .. versionchanged:: 1.5
1128+ remove ``horizon_scroll`` parameter
11161129 """
11171130 if not isinstance (content , (list , tuple , OutputList )):
11181131 content = [content ]
@@ -1131,9 +1144,8 @@ def put_scrollable(content=[], height=400, keep_bottom=False, horizon_scroll=Fal
11311144 min_height , max_height = height , height
11321145
11331146 spec = _get_output_spec ('scrollable' , contents = content , min_height = min_height , max_height = max_height ,
1134- keep_bottom = keep_bottom , horizon_scroll = horizon_scroll , border = border , scope = scope ,
1135- position = position )
1136- return Output (spec )
1147+ keep_bottom = keep_bottom , border = border , scope = scope , position = position )
1148+ return Output (spec ).enable_context_manager (container_selector = '> div' )
11371149
11381150
11391151@safely_destruct_output_when_exp ('tabs' )
0 commit comments