-
Notifications
You must be signed in to change notification settings - Fork 114
fix(ui): tooltip(options=) to use bsOptions DOM attribute
#2101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: schloerke <[email protected]>
ui.tooltip() options parameter to use bsOptions attribute
|
@copilot Add a changlelog entry |
Co-authored-by: schloerke <[email protected]>
Added in commit f8c5a2d |
ui.tooltip() options parameter to use bsOptions attributetooltip() options parameter to use bsOptions DOM attribute
tooltip() options parameter to use bsOptions DOM attributetooltip(options=) to use bsOptions DOM attribute
|
@copilot Fix the failing unit test - |
Co-authored-by: karangattu <[email protected]>
Fixed in commit 8b9d5c3. The test was failing because |
Modified the test to check for JSON keys encoded as HTML entities (e.g., "offset") instead of plain double quotes, reflecting the actual output format.
optionsparameter should be rendered asbsOptionsattribute in the web component (similar to popover)"options"to"bsOptions"to match popover implementationSummary
Fixed the
ui.tooltip()function to usebsOptionsattribute instead ofoptionswhen passing the options parameter to the bslib-tooltip web component.Changes made:
shiny/ui/_tooltip.pyline 147: Changed"options"to"bsOptions"to match the bslib web component APItests/pytest/test_ui.pyto verify the fixThis fix ensures that Bootstrap tooltip options (like
offset,customClass, etc.) are properly passed to the underlying bslib web component, matching the behavior ofui.popover()and the bslib JavaScript API.Original prompt
This section details on the original issue you should resolve
<issue_title>[Bug]: ui.tooltip kwarg "options" does not work</issue_title>
<issue_description>### Component
UI (ui.*)
Severity
P2 - Medium (workaround exists)
Shiny Version
1.5.0
Python Version
3.11.0
Minimal Reproducible Example
Behavior
Current: passing
optionstoui.tooltiphas no effect.Expected: the options are used as described in the Bootstrap doc as promised in the py-shiny doc
Error Messages (if any)
Environment