Skip to content

Commit 2229d25

Browse files
committed
fix: don't include selecitze script tag for normal select
1 parent 38aba75 commit 2229d25

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

shiny/ui/_input_select.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,19 @@ def _input_select_impl(
274274

275275
choices_tags = _render_choices(choices_, selected)
276276

277+
selectize_config = None
278+
if selectize:
279+
selectize_config = tags.script(
280+
json.dumps(options),
281+
selectize_deps(),
282+
type="application/json",
283+
data_for=resolved_id,
284+
# Which option values should be interpreted as JS?
285+
data_eval=json.dumps(extract_js_keys(options)),
286+
# Supply and retain these plugins across updates (on the client)
287+
data_default_plugins=default_plugins,
288+
)
289+
277290
return div(
278291
shiny_input_label(resolved_id, label),
279292
div(
@@ -285,16 +298,7 @@ def _input_select_impl(
285298
multiple=multiple,
286299
size=size,
287300
),
288-
tags.script(
289-
json.dumps(options),
290-
type="application/json",
291-
data_for=resolved_id,
292-
# Which option values should be interpreted as JS?
293-
data_eval=json.dumps(extract_js_keys(options)),
294-
# Supply and retain these plugins across updates (on the client)
295-
data_default_plugins=default_plugins,
296-
),
297-
selectize_deps() if selectize else None,
301+
selectize_config,
298302
),
299303
class_="form-group shiny-input-container",
300304
style=css(width=width),

0 commit comments

Comments
 (0)