Page 1 of 1

event listener to check selection

Posted: Thu Sep 15, 2022 3:58 pm
by SmitaPatil
Hi Team,

Can you please tell if there is any default eventlistener available to check if the complete tag is selected or just the some text of that tag.
As shown in below screenshot.
image.png
Thanks,
Smita

Re: event listener to check selection

Posted: Fri Sep 16, 2022 9:42 am
by mihaela
Hi Smita,

You can use the SelectionManager API to listen on selection changes events.

When the selection is changed, you can get the current selection using the sync.api.SelectionManager.getSelection method and then check if it is a fully selected element, using the sync.api.Selection.getFullySelectedNode method.

Best Regards,
Mihaela