Skip to content

Commit 0e56b27

Browse files
refactor: remove recursive call of _contains_html()
Co-authored-by: Barret Schloerke <[email protected]>
1 parent 6127ab2 commit 0e56b27

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

shiny/ui/_input_select.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,10 @@ def _normalize_choices(x: SelectChoicesArg) -> _SelectChoices:
343343
def _contains_html(x: _SelectChoices) -> bool:
344344
for v in x.values():
345345
if isinstance(v, Mapping):
346-
if _contains_html(cast(_OptGrpChoices, v)):
347-
return True
346+
# Check the `_Choices` values of `_OptGrpChoices`
347+
for vv in v.values():
348+
if not is instance(vv, str):
349+
return True
348350
else:
349351
if not isinstance(v, str):
350352
return True

0 commit comments

Comments
 (0)