Fix bootstrap dropdown does not open for AJAX loaded field#2660
Conversation
WalkthroughUpdated Bootstrap 5 compatibility in the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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 helperThe new
newReplacedFieldblock correctly mirrors the Bootstrap 5 conversion you already do inafterAddFieldand on initial DOM ready: it scopes work to the newly replaced field, updatesdata-toggle→data-bs-toggle, and ensures.frm-dropdown-menualso hasdropdown-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(currentfield.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
📒 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
…opdown_not_opening_for_ajax_loaded_fields Fix bootstrap dropdown does not open for AJAX loaded field
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