Open Oviglo opened 8 years ago
Hello, do you have informations about this ? I need to fix it for my client.
What do you mean by un-clicking dropdown.
Usually the logic of menus is that whole menu and action buttons should catch click events by event.stopPropagation()
and event.preventDefault()
, so the selection does not get removed from editable area. If selection removal is needed (ex. user has to write something to input). Then the previous selection must be saved before focus is lost/menu with input is opened:
var bookmark = editor.composer.selection.getBookmark();
and later before command is triggered the selection is restored:
editor.composer.selection.serBookmark(bookmark);
I try to save bookmark but it unselect cells:
If I select text it works, just the "wysiwyg-tmp-selected-cell" is removed
OK it work after add this function:
[code] $('.dropdown-toggle').click(function(event) { event.preventDefault(); var tableSelect = wysihtml5.dom.table.orderSelectionEnds(composer.tableSelection.start, composer.tableSelection.end); setTimeout(function() { composer.tableSelection.select(tableSelect.start, tableSelect.end); },0); });[/code]
Does it not work this way?
$('.dropdown-toggle').click(function(event) {
event.preventDefault();
event.stopPropagation();
});
The dropdown menu don't work with the stopPropagation function.
if toggle button parents need to listen to the click events of toggle buttons you must do the stopPropagation of click on parent elements, so the click bubbles to the listener but not further to document body.
Hi, I my editor I have a bootstrap dropdown for add cells (above, before etc.) the selected cells. But when un click on the drop down I wysihtml leave the cell selection, I set the cursor at the good position but the class "wysiwyg-tmp-selected-cell" is removing and the command don't work.
Can you help me please ? Thanks.