event listener to check selection

Having trouble installing Oxygen? Got a bug to report? Post it all here.
SmitaPatil
Posts: 93
Joined: Mon Aug 08, 2022 2:32 pm

event listener to check selection

Post 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
You do not have the required permissions to view the files attached to this post.
mihaela
Posts: 515
Joined: Wed May 20, 2009 2:40 pm

Re: event listener to check selection

Post 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
Mihaela Calotescu
http://www.oxygenxml.com
Post Reply