Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5100950

textarea.getSelectedText() returns the de-selected text, on XToolkit

XMLWordPrintable

    • b43
    • sparc
    • solaris_9
    • Verified

      I have a textarea and I am selecting some text from the text area. getSelectedText() returns the selected text properly. Now keeping the same text selected, I am selecting some text outside the text area, may be in another textarea or in a native window. The current selection in the textarea vanishes. But still ta.getSelectedText() returns the same text what it was returning before. This is incorrect. When the text in the text area is de-selected (either directly or indirectly by selecting some text outside the textarea) this method should return null or an empty string.

      This is reproducible only on XToolkit and works fine on Motif. This is reproducible on Linux / Solaris with tiger-beta2/rc. Not reproducible on win32.

      I have attached a sample test. Execute the sample test on the above mentioned platform. Select some text from the textarea and click the button. You should see the selected text on the console. Without disturbing the selection, select a different text on the console. Note that the textarea's selection disappears. Now click on the button. If you see the same text being printed on the console (what was shown before), the bug is reproduced.

            dcherepanov Dmitry Cherepanov
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: