mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2025-02-20 14:54:15 +01:00
(bug) prevent links on nothing in wysiwyg editor
This commit is contained in:
parent
11c8b25357
commit
5be2c79569
@ -47,6 +47,10 @@ export const MenuBar: React.FC<MenuBarProps> = ({ editor, heading, bulletList, b
|
||||
if (submenu !== type) {
|
||||
setSubmenu(type);
|
||||
if (type === 'link') {
|
||||
if (editor.view.state.selection.from === editor.view.state.selection.to) {
|
||||
setSubmenu('');
|
||||
return;
|
||||
}
|
||||
const previousUrl = {
|
||||
href: editor.getAttributes('link').href,
|
||||
target: editor.getAttributes('link').target || ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user