# Odd text area behaviour

**URL:** <https://forum.xojo.com/t/odd-text-area-behaviour/61058>\
**Category:** General\
**Created:** [February 9, 2021, 4:13am UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058 "2021-02-09T04:13:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Dotson](https://forum.xojo.com/user_avatar/forum.xojo.com/james_dotson/32/14811_2.png) [@James\_Dotson](https://forum.xojo.com/u/James_Dotson)\
**Post date:** [February 9, 2021, 4:13am UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/1 "2021-02-09T04:13:25Z")

</div>

I have a text area. When I click a button it takes the text from the text area and saves it to a database. The problem is that I have to click outside the text area before clicking the button or it won’t read the text. I worked around the problem by setting the focus to an invisible text field, but that hardly seems right. Am I missing something?

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 9, 2021, 8:04am UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/2 "2021-02-09T08:04:43Z")

</div>

Versons ?  
Xojo / OS

---

<div class="post-metadata">

**Author:** ![James\_Dotson](https://forum.xojo.com/user_avatar/forum.xojo.com/james_dotson/32/14811_2.png) [@James\_Dotson](https://forum.xojo.com/u/James_Dotson)\
**Post date:** [February 9, 2021, 3:59pm UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/3 "2021-02-09T15:59:00Z")

</div>

Windows 10. I don’t have the computer on, but I just downloaded it two weeks ago, so I assume it’s the current version. It’s not a big deal. I got it working. It just seems that it shouldn’t work that way.

---

<div class="post-metadata">

**Author:** ![Emile\_Schwarz](https://forum.xojo.com/letter_avatar_proxy/v4/letter/e/90ced4/32.png) [@Emile\_Schwarz](https://forum.xojo.com/u/Emile_Schwarz)\
**Post date:** [February 9, 2021, 6:37pm UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/4 "2021-02-09T18:37:56Z")

</div>

It shouldn’t and appears to not do that elsewhere.

A click outside the TextArea do nothing excepted if you write code and trap that click (clears the TextArea Focus for example).

Try to create a new project, add a TextArea and a button and add code in the button to copy the TextArea contents into the Clipboard.

Does it works ?

Also, you do not show the used code to create the New Data Base Record…

---

<div class="post-metadata">

**Author:** ![James\_Dotson](https://forum.xojo.com/user_avatar/forum.xojo.com/james_dotson/32/14811_2.png) [@James\_Dotson](https://forum.xojo.com/u/James_Dotson)\
**Post date:** [February 16, 2021, 8:16pm UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/5 "2021-02-16T20:16:13Z")

</div>

I found the problem for anyone who may experience this issue. If you type text into a text field or text area and then click a button it will read the text (if that is what your code does, of course). If you paste text in from the clipboard and click the button it will not read the text until you click elsewhere first. I don’t know why this happens, but I reproduced the results several times.

---

<div class="post-metadata">

**Author:** ![Tim\_Parnell](https://forum.xojo.com/user_avatar/forum.xojo.com/tim_parnell/32/161_2.png) [@Tim\_Parnell](https://forum.xojo.com/u/Tim_Parnell)\
**Post date:** [February 16, 2021, 8:18pm UTC](https://forum.xojo.com/t/odd-text-area-behaviour/61058/6 "2021-02-16T20:18:40Z")

</div>

> [@James\_Dotson](#):
>
> I don’t know why this happens, but I reproduced the results several times.

If you’ve reproduced the results in a small simple project, you should file a ticket. I can’t say that I’ve seen that behavior and am very curious about the implementation that makes it happen.
