Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for boostrap 5-style data- attributes. #4604

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

ninjanerdbgm
Copy link

Changed "data-toggle" to "data-bs-toggle"

What does this PR do?

Currently, with bootstrap 5, the dropdown toggles do nothing when you click this. This PR fixes that.

Where should the reviewer start?

  • The only file modified is src/styles/bs5/summernote-bs5.js

How should this be manually tested?

  • Install Bootstrap 5
  • Install summernote
  • Init summernote on an element in your dom
  • Click a button that contains a dropdown menu like font-size, style selection, font face, etc

Fix for one additional line
Should resolve nodejs build errors
@aloisejulian
Copy link

aloisejulian commented Mar 15, 2024

Hello... i have the same problem with the dropdowns. Do you know if this will be merged?

@DennisSuitters
Copy link
Member

Once @ninjanerdbgm fixes the commented outlined issues, then yes. For now, though, feel free to try the changes, and if you're able to fix it, create a PR, I'll check it, and merge if they work.

@@ -175,8 +175,8 @@ const ui = function(editorOptions) {

button: function($node, options) {
return renderer.create('<button type="button" class="note-btn btn btn-outline-secondary btn-sm" tabindex="-1">', function($node, options) {
if (options && options.data && options.data.toggle === 'dropdown') {
$node.removeAttr('data-toggle');
if (options && options.data && options.data['bs-toggle'] === 'dropdown') {
Copy link

Choose a reason for hiding this comment

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

I think this change is wrong. It needs to be
if (options && options.data && options.data['toggle'] === 'dropdown') {
otherwise it is still not working for me.

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.

None yet

4 participants