0
\$\begingroup\$

Is there a way to set the TMPro input text selection highlights programmatically (?)

Here are a few things I have tried.

Tried using .caretPosition and .selectionStringAnchorPosition

Tried using .SelectAll() but it is protected so extended. This however causes StackOverflowException: The requested operation caused a stack overflow. TMProInputExtend.SelectAll ()

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class TMProInputExtend : TMP_InputField
{ 
    public void SelectAll()
    {
        this.SelectAll();
    }
}

```
\$\endgroup\$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.