Skip to content

Commit 2364a85

Browse files
chore: add deprecations to input_select()
1 parent 478ceb7 commit 2364a85

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

shiny/ui/_input_select.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from .._deprecated import warn_deprecated
56
from ..types import Jsonifiable
67

78
__all__ = (
@@ -163,7 +164,7 @@ def input_select(
163164
multiple
164165
Is selection of multiple items allowed?
165166
selectize
166-
Whether to use selectize.js or not.
167+
Deprecated. Use ``input_selectize()`` instead of passing ``selectize=True``.
167168
width
168169
The CSS width, e.g. '400px', or '100%'
169170
size
@@ -192,6 +193,24 @@ def input_select(
192193
* :func:`~shiny.ui.input_radio_buttons`
193194
* :func:`~shiny.ui.input_checkbox_group`
194195
"""
196+
if selectize:
197+
warn_deprecated(
198+
"`selectize` parameter of `input_select()` is deprecated. "
199+
"Use `input_selectize()` instead of passing `selectize=True`."
200+
)
201+
202+
if remove_button is not None:
203+
warn_deprecated(
204+
"`remove_button` parameter of `input_select()` is deprecated. "
205+
"Use `input_selectize()` instead."
206+
)
207+
208+
if options is not None:
209+
warn_deprecated(
210+
"`options` parameter of `input_select()` is deprecated. "
211+
"Use `input_selectize()` instead."
212+
)
213+
195214
resolved_id = resolve_id(id)
196215

197216
x = _input_select_impl(
@@ -226,6 +245,8 @@ def _input_select_impl(
226245
if options is not None and selectize is False:
227246
raise Exception("Options can only be set when selectize is `True`.")
228247

248+
# TODO: Warn if remove is not None and selectize is False
249+
229250
remove_button = _resolve_remove_button(remove_button, multiple)
230251

231252
resolved_id = resolve_id(id)

0 commit comments

Comments
 (0)