Skip to content

Commit 3ff0fee

Browse files
committed
OXDEV-9988 Fix Bootstrap 5 dropdown conflict in Summernote toolbar
Add click handlers to toolbar dropdown buttons that toggle via Bootstrap's Dropdown API. This fixes dropdowns not opening due to Bootstrap 5's event delegation not recognizing dynamically created Summernote toolbar buttons.
1 parent 659d8b0 commit 3ff0fee

File tree

5 files changed

+44
-6
lines changed

5 files changed

+44
-6
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](http://semver.org/).
66

7+
## [6.0.2] - Unreleased
8+
9+
### Fixed
10+
- Summernote toolbar dropdowns not opening due to Bootstrap 5 event delegation conflict
11+
712
## [6.0.1] - 2025-11-10
813

914
### Fixed

assets/out/src/js/summernote/ddoesummernote.min.js

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/out/src/js/summernote/ddoesummernote.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

node_build/js/summernote/init.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ export async function initializeSummernote(element, options) {
6767
var summernote = element.summernote(settings);
6868
replaceLinkDialogModule(summernote);
6969
overrideEditorMethods(summernote);
70+
71+
// Fix Bootstrap 5 dropdown conflict - add click handlers to toggle via Bootstrap API
72+
const context = element.data('summernote');
73+
if (context && context.layoutInfo && context.layoutInfo.toolbar) {
74+
context.layoutInfo.toolbar.find('.dropdown-toggle').on('click', function(e) {
75+
e.preventDefault();
76+
e.stopPropagation();
77+
if (window.bootstrap && window.bootstrap.Dropdown) {
78+
window.bootstrap.Dropdown.getOrCreateInstance(this).toggle();
79+
}
80+
});
81+
}
82+
7083
return summernote;
7184
}
7285

tests/Codeception/Acceptance/TextareaCheckCest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,26 @@
1515
#[Group('ddoewysiwyg')]
1616
final class TextareaCheckCest
1717
{
18+
public function summernoteFontSizeDropdownWorks(AcceptanceTester $I): void
19+
{
20+
$I->wantToTest('Summernote font size dropdown opens when clicked');
21+
22+
$adminPanel = $I->loginAdmin();
23+
$adminPanel->openProducts();
24+
$I->selectEditFrame();
25+
26+
$I->waitForElement('.note-editor', 15);
27+
$I->wait(3);
28+
29+
$fontSizeDropdownButton = '.note-toolbar .note-fontsize button.dropdown-toggle';
30+
$I->waitForElementClickable($fontSizeDropdownButton, 5);
31+
32+
$I->click($fontSizeDropdownButton);
33+
$I->wait(1);
34+
35+
$I->seeElement('.note-toolbar .note-fontsize .dropdown-menu.show');
36+
}
37+
1838
public function productDescriptionTextAreaModified(AcceptanceTester $I): void
1939
{
2040
$I->wantToTest('Module improves the product description textarea');

0 commit comments

Comments
 (0)