Skip to content

Fix bootstrap dropdown does not open for AJAX loaded field#2660

Merged
Crabcyborg merged 1 commit into
masterfrom
fix_issues_with_bootstrap_dropdown_not_opening_for_ajax_loaded_fields
Dec 15, 2025
Merged

Fix bootstrap dropdown does not open for AJAX loaded field#2660
Crabcyborg merged 1 commit into
masterfrom
fix_issues_with_bootstrap_dropdown_not_opening_for_ajax_loaded_fields

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Fixes https://github.com/Strategy11/formidable-pro/issues/6143

This is related to the Bootstrap 5 update. We're updating some old attributes, but those weren't working for an AJAX loaded field.

Pre-release
formidable-6.26.1b.zip

@coderabbitai

coderabbitai Bot commented Dec 15, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

Updated Bootstrap 5 compatibility in the handleAjaxLoadFieldSuccess function by replacing data-toggle attributes with data-bs-toggle and ensuring newly inserted dropdown menus receive the dropdown-menu class for proper tooltip and dropdown initialization.

Changes

Cohort / File(s) Change Summary
Bootstrap 5 Compatibility Update
js/src/admin/admin.js
Modified handleAjaxLoadFieldSuccess to set data-bs-toggle attributes instead of data-toggle and ensured dropdown menus receive the dropdown-menu class for AJAX-loaded field elements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and specifically describes the main change: fixing Bootstrap dropdown functionality for AJAX-loaded fields, which matches the core objective of the pull request.
Description check ✅ Passed The pull request description clearly references a specific issue and explains the Bootstrap 5 compatibility fix for AJAX-loaded fields, directly relating to the changeset.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix_issues_with_bootstrap_dropdown_not_opening_for_ajax_loaded_fields

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
js/src/admin/admin.js (1)

2121-2133: Bootstrap 5 initialization for AJAX‑loaded fields looks correct; consider small reuse helper

The new newReplacedField block correctly mirrors the Bootstrap 5 conversion you already do in afterAddField and on initial DOM ready: it scopes work to the newly replaced field, updates data-toggledata-bs-toggle, and ensures .frm-dropdown-menu also has dropdown-menu. That should fix dropdowns/tooltips on AJAX‑loaded fields without touching unrelated DOM.

If you want to tighten things up later, you could extract a tiny helper like initBootstrapDropdownsForField(container) and call it from:

  • afterAddField (current field.querySelectorAll(...)),
  • handleAjaxLoadFieldSuccess (the new block), and
  • the ready handler for the initial document scan,

to keep the Bootstrap‑5 glue in one place. Behavior is fine as‑is, so this is an optional DRY refactor.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e7cc4f1 and 60f8404.

📒 Files selected for processing (1)
  • js/src/admin/admin.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
js/src/admin/admin.js (3)
classes/helpers/FrmHtmlHelper.php (1)
  • toggle (27-36)
js/src/frm_testing_mode.js (1)
  • toggle (37-37)
js/admin/style.js (1)
  • dropdownMenu (684-688)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Cypress
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 7.4 tests in WP trunk
  • GitHub Check: PHP 8 tests in WP trunk
  • GitHub Check: Cypress

@Crabcyborg Crabcyborg modified the milestones: 6.27, 6.26.1 Dec 15, 2025
@Crabcyborg
Crabcyborg merged commit e226d8f into master Dec 15, 2025
36 checks passed
@Crabcyborg
Crabcyborg deleted the fix_issues_with_bootstrap_dropdown_not_opening_for_ajax_loaded_fields branch December 15, 2025 16:40
stephywells pushed a commit that referenced this pull request Apr 4, 2026
…opdown_not_opening_for_ajax_loaded_fields

Fix bootstrap dropdown does not open for AJAX loaded field
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant