You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm not sure how to achieve this. On my ImageComponent I have registered both the KEY_BACKSPACE_COMMAND and the KEY_DELETE_COMMAND. Both call the function onDelete().
All works fine with the second one since it requires selecting the image before removing it, so what I need (getting into the if that has the onRemove), is achieved:
But, with backspace both isSelected && $isNodeSelection($getSelection()) are false and the ifs are not executed, anyway, the imageNode ends up being deleted anyway when the paragraphNode is deleted. I need to capture the imageNode deleted there.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I'm not sure how to achieve this. On my ImageComponent I have registered both the KEY_BACKSPACE_COMMAND and the KEY_DELETE_COMMAND. Both call the function onDelete().
All works fine with the second one since it requires selecting the image before removing it, so what I need (getting into the if that has the onRemove), is achieved:
But, with backspace both isSelected && $isNodeSelection($getSelection()) are false and the ifs are not executed, anyway, the imageNode ends up being deleted anyway when the paragraphNode is deleted. I need to capture the imageNode deleted there.
Any suggestions? Thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions