2

I have a problem which makes me crazy. I have created a scroll rect in unity with a lot of Input Field's like in picture below.

enter image description here

My problem is : I can't scroll!!! Every time when I try, the keyboard it's opened. Scroll it's able just if I hit the red space between the Input field's.

I am thinking that the problem is because the keyboard appears on OnPointerDown and not OnPointerUp or OnPointerClick. I tried to add a EventTrigger component to InputField and add actions for OnPointerDown and OnPointerUp but I had no success to change keyboard behavior.

Any help? Any ideas? Please! Thanks a lot!

Gaby Fitcal
  • 1,814
  • 1
  • 17
  • 28
  • Hmm i am somewhat certain, that there must be a less hacky way, but i suppose you could create an invisible area/image on top of the input field and track in the event of that area/object/image how far the scrolling was/if any. and if the scrolling was below a certain distance than you can decide "hey this was actually supposed to go to the input field" and call the input field event.. i guess? =) – Calined Dec 19 '16 at 10:21

1 Answers1

6

You can create Button and attach InputField as child of it, then:

  1. add button OnClick event InputField.Select()
  2. Disable Raycast Target for InputField, Placeholder and Text

To hide button you can make it transparent.

Artur
  • 69
  • 1
  • 2
  • 1
    I've tried that approach, but it doesn't seem to be working. When I tap the button it indeed calls inputField.Select(), but at the same I cannot scroll anymore. And if I disable Raycast target inside this button I cannot click it anymore so it doesn't make sense. – Makalele Mar 17 '20 at 14:38