Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UITextField is it possible to ignore escape characters?

Discussion in 'UI Toolkit' started by JSwanFin, Jun 18, 2021.

  1. JSwanFin

    JSwanFin

    Joined:
    Apr 10, 2013
    Posts:
    19
    I am creating an editor window with a file location selector. I am using UITextField where the user can enter (or copy & paste) the file location and it also naturally shows the current entry. The problem is that some character combinations are interpreted as escape codes. Like a directory path that contains: "/N". I can filter those out, but it makes the job a bit more laborious.

    Is there a way to tell UITextField to ignore all escape sequences and treat the text as is?
     
  2. HugoBD-Unity

    HugoBD-Unity

    Unity Technologies

    Joined:
    May 14, 2018
    Posts:
    440
    Hi @JSwanFin!

    We have a ticket already open that tracks this. In the mean time, I think replacing all " \ " with " \\ " will solve this issue. Let me know if this works.
     
  3. JSwanFin

    JSwanFin

    Joined:
    Apr 10, 2013
    Posts:
    19
    thanks for the quick reply and good to know it is already being worked on. The solution you suggest is what I'll do. I'll ask more in case of problems.
     
    HugoBD-Unity likes this.