ECMS-6321: [Insert Portal Link] TypeError in Inline edit mode

Fix description:
- Use other function to get selected text