# Bug (?) with element.x.caretPosition \[FIXED??\]

**URL:** <https://forum.servoy.com/t/bug-with-element-x-caretposition-fixed/5473>\
**Category:** Classic Servoy\
**Created:** [February 14, 2006, 3:03am UTC](https://forum.servoy.com/t/bug-with-element-x-caretposition-fixed/5473 "2006-02-14T03:03:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aUser](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@aUser](https://forum.servoy.com/u/aUser)\
**Post date:** [February 14, 2006, 3:03am UTC](https://forum.servoy.com/t/bug-with-element-x-caretposition-fixed/5473/1 "2006-02-14T03:03:54Z")

</div>

Very simple test code:

```auto
application.output(elements.letterText.caretPosition);

```

run from a button on the same form as letterText.

Select empty letterText in a new record, type “abc”, and push the button; the script outputs **0**! Return to letterText and click after the “c”; the script outputs **3.0**. The on-screen caret is in the same place (after the “c”) in both cases but the result is different. Perhaps caretPosition isn’t updated correctly as you type?

Help please.

---

<div class="post-metadata">

**Author:** ![jcompagner](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/jcompagner/32/4889_2.png) [@jcompagner](https://forum.servoy.com/u/jcompagner)\
**Post date:** [February 14, 2006, 12:17pm UTC](https://forum.servoy.com/t/bug-with-element-x-caretposition-fixed/5473/2 "2006-02-14T12:17:00Z")

</div>

in 3.0 i optimized/fixed the cursor handling.  
Can’t do it currently for 2.2 because there could be some difference between the (initial) cursor positions now then before.

---

<div class="post-metadata">

**Author:** ![aUser](https://avatars.discourse-cdn.com/v4/letter/a/5e9695/32.png) [@aUser](https://forum.servoy.com/u/aUser)\
**Post date:** [February 18, 2006, 2:58am UTC](https://forum.servoy.com/t/bug-with-element-x-caretposition-fixed/5473/3 "2006-02-18T02:58:37Z")

</div>

This seems to be fixed in 2.2.4. Given your response above, I’m not sure if you did that on purpose, but in any case, thanks!
