# On inputText click the pointer should not go through it

**URL:** <https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336>\
**Category:** Bugs\
**Tags:** gui\
**Created:** [July 20, 2022, 10:11am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336 "2022-07-20T10:11:58Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 20, 2022, 10:11am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/1 "2022-07-20T10:11:58Z")

</div>

Hey,  
How can I stop picking go through InputText element?  
isPointerBlocker doesn’t seem to work 🤔

[https://playground.babylonjs.com/#UWS0TS#228](https://playground.babylonjs.com/#UWS0TS#228)

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [July 20, 2022, 12:35pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/2 "2022-07-20T12:35:00Z")

</div>

No, the pointerBlocker will not work for inputText. In a way, I believe it’s understable and consistent: Why have an inputText if you cannot input text, yes?  
There are a number of work-arounds you can use. The most obvious is to remove the observable (freeze the control) when entering the area (generally a placeholder/container for the inputText).  
A bit of the same you would do with other controls such as i.e. the scrollviewer, depending on context.  
Actually, good question: what is the context? Where the inputText is visible but cannot be used?

Edit: You don’t have to answer (unless you want 😉 I believe ‘isReadOnly’ depending on context is probably the best option

> **[Babylon.js Playground](https://playground.babylonjs.com/#UWS0TS%23231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 20, 2022, 6:27pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/3 "2022-07-20T18:27:02Z")

</div>

Hi,  
I can answer with other question, Why to use InputText without inputText functionality? then simple use TextBlock instead 😉 …buut this is not the case. It is actualy a menu linked to a customizable mesh, so based on user input value we update the mesh, so the user definetly have to click the input.

I think I’m missing something ☹

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [July 20, 2022, 8:09pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/4 "2022-07-20T20:09:52Z")

</div>

I understand. Makes sense. However, the PG above should work for your use case.  
Click on the button to unlock the InputText.  
Simply use ‘isReadOnly’ (true or false) depending on whether you want the input editable or locked.  
Anything I missed here?

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 21, 2022, 6:09am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/5 "2022-07-21T06:09:24Z")

</div>

> [@mawa](#):
>
> Anything I missed here?

Basically the main issue, on input click the pointer should not go through it

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [July 21, 2022, 7:03am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/6 "2022-07-21T07:03:02Z")

</div>

The pointerUp? I thought you just wanted to block the text input.

Edit: We must have a different understanding of this. Can you explain with other words what you mean when you say “On inputText click the pointer should not go through it”. I’m afraid I’m not understanding this correctly.

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 21, 2022, 7:36am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/7 "2022-07-21T07:36:50Z")

</div>

Oh, sory. I’ll try in other way then.  
If you open the console you’ll see the name of clicked mesh. Now if you click the gui button ‘click me’ the name of mesh is not showed (I would say expectd because is a gui element). but if you click on input, the name of mesh is showed (unexpected)

---

<div class="post-metadata">

**Author:** ![MarianG](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mariang/32/138_2.png) [@MarianG](https://forum.babylonjs.com/u/MarianG)\
**Post date:** [July 21, 2022, 7:40am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/8 "2022-07-21T07:40:24Z")

</div>

I checked again and with 4.2.1 version it is working well. So it is a bug 😮 and has nothing to do with isPointerBlocker

---

<div class="post-metadata">

**Author:** ![mawa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mawa/32/12384_2.png) [@mawa](https://forum.babylonjs.com/u/mawa)\
**Post date:** [July 21, 2022, 8:33am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/9 "2022-07-21T08:33:04Z")

</div>

Thanks for the new info.  
I indeed misunderstood your question. It’s much clearer now  
I am not sure it’s a bug. Changes have been made to this control.  
I suppose I found a solution or go-around, if I (finally 😉 understand correctly what you want.  
In this PG, using onBlurObservable you can edit the input without picking the sphere until you confirm the input (pressing ‘enter’).

> **[Babylon.js Playground](https://playground.babylonjs.com/#UWS0TS%23232)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

Let me just call-in @carolhmj to understand if this is a new and expected behavior or a bug?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 21, 2022, 11:21am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/10 "2022-07-21T11:21:26Z")

</div>

I’ll investigate and discuss with @RaananW 🤔

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 21, 2022, 11:21am UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/11 "2022-07-21T11:21:29Z")

</div>



---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 21, 2022, 12:57pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/12 "2022-07-21T12:57:32Z")

</div>

I tested with some more different controls and Rectangle, Image and Checkbox all have the same behavior as Button, so it does seem there is something going on with InputText: [pannel button and input | Babylon.js Playground (babylonjs.com)](https://playground.babylonjs.com/#UWS0TS#234)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 22, 2022, 7:23pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/13 "2022-07-22T19:23:53Z")

</div>

Finally found out the cause 😃 PR is here [isPointerBlocker fixes by carolhmj · Pull Request #12787 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/12787)

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [July 28, 2022, 1:14pm UTC](https://forum.babylonjs.com/t/on-inputtext-click-the-pointer-should-not-go-through-it/32336/14 "2022-07-28T13:14:20Z")

</div>


