Skip to content

fix(js): use Bootstrap 5 vanilla API for tooltips - #2723

Merged
mroderick merged 1 commit into
masterfrom
feature/fix-bootstrap-5-tooltip
Jul 28, 2026
Merged

fix(js): use Bootstrap 5 vanilla API for tooltips#2723
mroderick merged 1 commit into
masterfrom
feature/fix-bootstrap-5-tooltip

Conversation

@mroderick

@mroderick mroderick commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Unblocks local verification of #2721.

Problem

$('[data-bs-toggle="tooltip"]').tooltip() is not a function in Bootstrap 5, because the bootstrap gem ships vanilla JS rather than jQuery plugins. The resulting TypeError aborts the $(function() {...}) callback in application.js before Chosen is initialised, which breaks any feature that depends on Chosen (e.g. the admin event chapters dropdown).

Change

  • Replace the jQuery tooltip call with Bootstrap 5's vanilla API in app/assets/javascripts/application.js.
  • Update spec/features/admin/meeting_spec.rb to assert the organiser avatar's alt text instead of the tooltip title attribute. Bootstrap 5's Tooltip constructor moves title to data-bs-original-title and removes the original attribute, so the previous assertion only passed while tooltips were broken.

Verification

  • JS syntax check passes.
  • bundle exec rspec spec/features/admin/meeting_spec.rb --seed 6016 — 9 examples, 0 failures.
  • bundle exec parallel_rspec spec/ -n 6 --only-group 4 --test-options '--seed 6016' — 175 examples, 0 failures.
  • All CI groups pass.

Related

@mroderick
mroderick force-pushed the feature/fix-bootstrap-5-tooltip branch 2 times, most recently from d24b811 to 33be9cc Compare July 25, 2026 16:44
@mroderick
mroderick marked this pull request as ready for review July 25, 2026 16:48

@KimberleyCook KimberleyCook left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

`$('[data-bs-toggle="tooltip"]').tooltip()` is not a function in Bootstrap 5
because the bootstrap gem ships vanilla JS. The resulting TypeError aborted
the application.js DOM-ready callback before Chosen was initialised, breaking
Chosen-dependent dropdowns.

Replace the jQuery call with Bootstrap 5's vanilla API and update the
meeting feature spec to assert the organiser avatar's alt text instead of
tooltip title, since Bootstrap 5's Tooltip constructor moves title to
data-bs-original-title.
@mroderick
mroderick force-pushed the feature/fix-bootstrap-5-tooltip branch from 33be9cc to 5750ea0 Compare July 28, 2026 09:59
@mroderick
mroderick enabled auto-merge July 28, 2026 10:00
@mroderick
mroderick merged commit cc01c77 into master Jul 28, 2026
9 checks passed
@mroderick
mroderick deleted the feature/fix-bootstrap-5-tooltip branch July 28, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants