# How can I forbid selection text by mouse in Editable Text?

**URL:** <https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234>\
**Category:** UI\
**Tags:** cursor, text, unreal-engine, mouse-click, question, UMG\
**Created:** [November 30, 2020, 6:19pm UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234 "2020-11-30T18:19:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shedels](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shedels/32/1121823_2.png) [@Shedels](https://forums.unrealengine.com/u/Shedels)\
**Post date:** [November 30, 2020, 6:19pm UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/1 "2020-11-30T18:19:54Z")

</div>

1. How to make sure that when changing the text in Editable Text, the cursor does not automatically move to the end of the line? For example, you click on a character in the middle of a line, delete, and the cursor runs to the end.

2. How to remove the ability to select a line / part of a line by holding down the mouse button in Editable Text?

![323523-1.gif](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/c/4/5c4ac7334d8fdd7dafefd60e6b4765fdad0f4caf.gif)

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 1, 2020, 2:02am UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/2 "2020-12-01T02:02:37Z")

</div>

> For example, you click on a character  
> in the middle of a line, delete, and  
> the cursor runs to the end.

Hm, it does not? Are you manually shifting focus? Any script in `OnTextChanged`?

[![Image from Gyazo](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/6/6/366af30bcd455681209e19239bc92cccfcf98d6d.gif)](https://gyazo.com/8101f8c4349f59010e398f42c1c5b63b)

> How to remove the ability to select a  
> line / part of a line by holding down  
> the mouse button in Editable Text?

I believe you’d need to set it to `Not Hit-Testable` as _isReadOnly_ merely prevents inputting. Other than that, you could try wrapping the editable text with a user widget and passing `Unhandled` in `onMouseDown` - untested, though; could work.

---

<div class="post-metadata">

**Author:** ![Shedels](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shedels/32/1121823_2.png) [@Shedels](https://forums.unrealengine.com/u/Shedels)\
**Post date:** [December 1, 2020, 4:00am UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/3 "2020-12-01T04:00:17Z")

</div>

1. Yeeeeees i have some code which is setting text by loope which is check every letter…

2. I have some text marked by IsReadOnly and i can select it too.

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 1, 2020, 8:41am UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/4 "2020-12-01T08:41:03Z")

</div>

Well, don’t do the thing that you do _every letter_ or do it differently. And, as I said, `isReadOnly` will not work here.

---

<div class="post-metadata">

**Author:** ![Shedels](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shedels/32/1121823_2.png) [@Shedels](https://forums.unrealengine.com/u/Shedels)\
**Post date:** [December 2, 2020, 5:32pm UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/5 "2020-12-02T17:32:40Z")

</div>

Well, i tried to set it Not Hit-Testable but it also prevent inputting.  
Can you show variant with unhandled?

---

<div class="post-metadata">

**Author:** ![Shedels](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/shedels/32/1121823_2.png) [@Shedels](https://forums.unrealengine.com/u/Shedels)\
**Post date:** [January 11, 2021, 4:09pm UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/6 "2021-01-11T16:09:55Z")

</div>

C++ helps. Closed.

---

<div class="post-metadata">

**Author:** ![HashemShepard](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hashemshepard/32/1201564_2.png) [@HashemShepard](https://forums.unrealengine.com/u/HashemShepard)\
**Post date:** [April 24, 2022, 11:37pm UTC](https://forums.unrealengine.com/t/how-can-i-forbid-selection-text-by-mouse-in-editable-text/475234/7 "2022-04-24T23:37:52Z")

</div>

how did it help ?
