Text editor mouse down behaviour when locked


#1

Hi Jules,

I just found an issue, i think, with the TextEditor. If your in read only multiline mode, no caret, no popup etc... (these settings seem to make no difference) and some kind of background routine is filling it with data, if you then click anywhere in the text editor it will insert incoming text from the background routine at the point you click until you release the mouse. I would have thought that if the editor was locked you wouldnt be able to set the caret position with the mouse at all.

Thanks!


#2

Hmm - ok, but the idea is that even in that mode, the user can highlight sections of the text and copy it to the clipboard.

I could add yet another flag to indicate "no user interaction at all" but actually, you could just call setInterceptsMouseClicks (false, false) to get the same result?


#3

Its a bit of a catch-22 there I guess as I would like to be able to select text and copy it (and clearly it makes total sense that the TextEditor functions in this way), but not have incoming text placed where I mouse down. Oh well!


#4

Does this happen even if you moveCaretToEnd() before inserting the text?

Rail


#5

that was what I was missing! Thanks very much Rail, what an easy solution. Apologies for wasting your time Jules.