EditManager.applyLink not removing links if there is no selection
If the cursor is 'inside' a link, editManager.applyLink(null, null, true) does not remove the link. If, instead, you have a small selection that includes a subset of the link, it works as expected. Is this the intended behavior?
My current workaround is attached, but it has the sideeffect of causing the cursor's position to be lost. Is there a way around that problem?
Edit: I was incorrect about losing the cursor position. The process of removing the link was shifting the focus, and a simple setFocus call fixed that problem. Is this workaround otherwise reasonable?
var edit:EditManager = textFlow.interactionManager as EditManager;
if(edit.isRangeSelection()) { edit.applyLink(null, null, true); } else { edit.beginCompositeOperation(); var position:int = edit.absoluteStart; edit.selectRange(position, position+1); edit.applyLink(null, null, true); edit.selectRange(position, position); edit.endCompositeOperation(); }
Message was edited by: mattrichard
