input field in scrollview

Hi there :slight_smile:
if i have a input field in a scroll view i can’t scroll the view when over the input field instead it selects the input field is there a way to only select the input field on a release and if sliding finger scroll the view?

same happens with buttons.

Thanks
Mike

Selection currently happens OnPointerDown which maybe is not desired at times. As for a solution you’d likely need to derive from the class thats causing you issues and then override OnPointerDown and not call base.OnPointerDown

Sorry to dig up an old thread here, but I’ve stumbled across this in looking for a solution to this problem.

I’m having the same problem with an InputField in a ScrollRect control. When a user is scrolling, if they hit the input field first, it selects. I’ve tried doing what was suggested here, but it still triggers the selection.

I’ve created a class as below:

public class CustomInputField : InputField
{
    public override void OnPointerDown(PointerEventData eventData)
    {
        Debug.Log("OnPointerDown");
    }
}

The debug happens, but selection is still happening. Is there something I’ve missed?

i got round this problem by covering the input field with a button and telling the button to select the input field.

for example make a function called ActivateInputField that the button can trigger, worked well for me

public void ActivateInputField ()
{
inputField.ActivateInputField ();
}

2 Likes

This is still the case and its completely undesirable. Why do we do this for TMP_InputField? This is totally a problem when you have a sign up form.