Skip to content

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

Open
mroderick wants to merge 1 commit into
masterfrom
feature/fix-bootstrap-5-tooltip
Open

fix(js): use Bootstrap 5 vanilla API for tooltips#2723
mroderick wants to merge 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 from 718dfc8 to d24b811 Compare July 25, 2026 16:36
`$('[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 d24b811 to 33be9cc Compare July 25, 2026 16:44
@mroderick
mroderick marked this pull request as ready for review July 25, 2026 16:48
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.

1 participant