Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Improvements

* Removed statement that you could pass HTML into `update_selectize` choices. This never worked. Please use `options.render` (see example under `input_selectize`). (#2048)

* Improved the styling and readability of markdown tables rendered by `ui.Chat()` and `ui.MarkdownStream()`. (#1973)

* `selectize`, `remove_button`, and `options` parameters of `ui.input_select()` have been deprecated; use `ui.input_selectize()` instead. (Thanks, @ErdaradunGaztea!) (#1947)
Expand Down
8 changes: 1 addition & 7 deletions shiny/ui/_input_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ._html_deps_external import selectize_deps
from ._utils import JSEval, extract_js_keys, shiny_input_label

_Choices = Mapping[str, TagChild]
_Choices = Mapping[str, str]
_OptGrpChoices = Mapping[str, _Choices]

# Canonical format for representing select options.
Expand Down Expand Up @@ -259,12 +259,6 @@ def _input_select_impl(

choices_ = _normalize_choices(choices)

if _contains_html(choices_):
warn_deprecated(
"Passing anything other than a string to `choices` parameter of "
"`input_select()` and `input_selectize()` is deprecated."
)

selected = restore_input(resolved_id, selected)
if selected is None and not multiple:
selected = _find_first_option(choices_)
Expand Down
12 changes: 4 additions & 8 deletions shiny/ui/_input_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ def update_select(
An input label.
choices
Either a list of choices or a dictionary mapping choice values to labels. Note
that if a dictionary is provided, the keys are used as the (input) values so
that the dictionary values can hold HTML labels. A dictionary of dictionaries is
that if a dictionary is provided, the keys are used as the (input) values.It is not recommended to use
anything other than a string for these labels. A dictionary of dictionaries is
also supported, and in that case, the top-level keys are treated as
``<optgroup>`` labels.
selected
Expand Down Expand Up @@ -746,15 +746,11 @@ def update_selectize(
if choices is not None:
for k, v in _normalize_choices(choices).items():
if not isinstance(v, Mapping):
flat_choices.append(
FlatSelectChoice(value=k, label=session._process_ui(v)["html"])
)
flat_choices.append(FlatSelectChoice(value=k, label=v))
else: # The optgroup case
flat_choices.extend(
[
FlatSelectChoice(
optgroup=k, value=k2, label=session._process_ui(v2)["html"]
)
FlatSelectChoice(optgroup=k, value=k2, label=v2)
for (k2, v2) in v.items()
]
)
Expand Down
Loading