Skip to content

Commit

Permalink
Correctly detect the Edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
hieutbui authored and dab246 committed Jan 16, 2024
1 parent 956859c commit 500f771
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/src/widgets/html_editor_widget_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,14 @@ class _HtmlEditorWidgetWebState extends State<HtmlEditorWidget> {
callbacks =
"""$callbacks \$('#summernote-2').on('summernote.mouseup', function(_, context) {
\$('.note-link-popover').off('click').on('click', function(e) {
if (e.target.className == 'note-icon-link' || e.target.className == 'note-btn') {
let isNoteIconLink = false;
if (e.target.className === 'note-icon-link') {
isNoteIconLink = true;
} else if (e.target.className === 'note-btn') {
const targetChildrenArray = Array.from(e.target.children);
isNoteIconLink = targetChildrenArray.some(child => child.classList.contains('note-icon-link'));
}
if (isNoteIconLink) {
var linkTag = context.target;
const linkTagId = 'id_' + new Date().getTime();
linkTag.id = linkTagId;
Expand Down

0 comments on commit 500f771

Please sign in to comment.