0 Replies Latest reply on Feb 7, 2012 6:25 AM by prithvi.zankat

    How to get selected text from spark TextInput?

    prithvi.zankat

      I have a spark TextInput. I wanted to copy selected text programatically.


      See the following image -

       

      I want that only selection should get copied when click RW:Copy button clicked.

      One way is to get selection range using selectionActivePosition and selectionAnchorPosition and then get sub string of TextInput's text, but it will not work as expected.

      It will not work because TextInput's text do not count whilte spaces after new line.

       

      Is there any othe way to do this?


      text Selection.png

      Thanks in advance,

      Prithveesingh Zankat.