Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

Can't move the carret on a selected inputfield

Discussion in 'UGUI & TextMesh Pro' started by dedefac96, Oct 15, 2020.

  1. dedefac96

    dedefac96

    Joined:
    Sep 18, 2018
    Posts:
    15
    There's no way to position the carret while i've selected the inputfield with TMP.
    If i do this with just the basic inputfield, it works (at the bottom of this video)



    I have found no answer on the web..

    I feel like it's related to this commented lines TMP_InputField.cs :

    Code (CSharp):
    1.             //else if (m_HideMobileInput) // m_Keyboard.canSetSelection
    2.             //{
    3.             //    int length = stringPositionInternal < stringSelectPositionInternal ? stringSelectPositionInternal - stringPositionInternal : stringPositionInternal - stringSelectPositionInternal;
    4.             //    m_SoftKeyboard.selection = new RangeInt(stringPositionInternal < stringSelectPositionInternal ? stringPositionInternal : stringSelectPositionInternal, length);
    5.             //}
    6.             //else if (!m_HideMobileInput) // m_Keyboard.canGetSelection)

    Someone has a link to share or a solution ?

    NB: Changing the "Hide Mobile Input" property doesn't change anything and this bug happens only on mobile, editor is fine.
     
    Last edited: Oct 15, 2020
  2. dedefac96

    dedefac96

    Joined:
    Sep 18, 2018
    Posts:
    15
    So i won't get any answer from the dev who are working on TextMeshPro ? It's really a bug that should be fixed...
     
  3. dedefac96

    dedefac96

    Joined:
    Sep 18, 2018
    Posts:
    15
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    What settings do you have on those two input fields?

    I just tested using version 1.5.3 of TMP in Unity 2018.4 on Android with Hide Mobile Input Enabled and was able to correctly move the caret.

    Having said that, there are behavioral issues related to how the soft keyboard automatically hides on focus change on Android.

    For instance, when I first select the TMP Input Field, the caret is inserted at the correct location and the soft keyboard shows up and now has focus. If I click again on the TMP Input Field, the soft keyboard is automatically closed and as such I have to again click the TMP Input Field for the caret to show up as well as the soft keyboard. This is certainly goofy in terms of behavior and something that I have brought up to the Android team several times. We should be able to keep the Android soft keyboard open until we specifically choose to close it like we can on iOS.

    Once the Caret is in the TMP Input Field, dragging to make a selection is also iffy (technical term) it works but you sort of have to insist on it with your finger as you drag around. Again not ideal behavior which I suspect is again Android soft keyboard behavior related. (I will double check that just in case)

    In terms of the UI Input Fields, on my Android device I simply cannot make a selection / insert the caret with hide mobile input.

    What version of Unity and TMP are you using?

    P.S. I also noticed the soft keyboard remains on screen in your case. Am I watching a video from the actual device or is this thru the emulator?

    I also do not get the bubble / circle on my device when trying to move the caret around. Not sure if that is a setting on the device? How do you get that to show up?
     
  5. dedefac96

    dedefac96

    Joined:
    Sep 18, 2018
    Posts:
    15
    Sorry, i wasn't expecting an answer anymore. Thanks for your help.
    I'm on 2019.4.18 with the last TMP updates, still not working.

    I have to say i'm not sure to understand the behaviour you're explaining, it doesn't seem to be the same as on the video.
    If it close every time you click a second time, then you're not able to move the carret properly neither.

    The first click on the unselected inputfield does take in consideration the good place of the carret, but then no matter how many times i select a position on the selected inputfield, the carret doesn't change.

    It was a record from my device (honor 10), many other users of my app reported me this issue.
    the bubble is just included in the record screen feature i have on the honor 10.


    ALSO, there was an issue with hiding the native input. Indeed, it seems the app was still considering the native input. I mean, we don't see it, but the area where it would have been is unclickable. If i click there, the keyboard stays open while it should close.

    I've just concluded that hide input feature is really not well handled on unity so i gave it up.
    I just display the native input which is ugly but i least, i can move the carret properly in it + i don't have this blocked area.
     
    Last edited: Feb 9, 2021
  6. Tomsterk

    Tomsterk

    Joined:
    Nov 23, 2012
    Posts:
    10
    This is still an issue. A TMP_InputField which is already selected cannot have the caret change position when tapped, it always appears wherever it was before (in our case, we select by code so it is at the end).
     
    ltomov likes this.
  7. Tulrath

    Tulrath

    Joined:
    Feb 1, 2015
    Posts:
    13
    Bump!

    A TMP_InputField which is already selected cannot have the caret change position when tapped when Hide Mobile Input is checked. It has to (somehow) lose focus first. If I am editing the contents of a multi-line input field, and tap anywhere in the input area, the caret does not change position.

    Additionally, I cannot drag-select at all. I would like to allow the user to use the TMP_InputField and the Legacy InputField as an inputfield. Forcing the user to use the Mobile Keyboard AND the Mobile Input Field AND the Unity Input Field (either Legacy or TMP) all at the same time is horribly confusing for users.

    The same issue exists for a Legacy InputField.

    This is still an issue in both:
    • 2022.3.9f1 (Long Term Support)
    • 2023.2.0b8 (Pre-Release Beta)

    While we are on the subject of InputFields. PLEASE can we either...
    1. Get full Emoji support in the Legacy Text/InputField (which can fully use OTF/TTF font files) and also get full Right-to-Left language support, OR
    2. Enable TMP to use OTF/TTF fonts without having to build a Font Atlas
    The TMP Font Atlas is horribly inefficient for any language that uses more than a couple hundred glyphs (like Chinese or Devanagari-based language (i.e. Hindi, Nepali, etc...)).

    Yes, I know what you are going to say, "just make a Font Atlas just containing the glyphs you need to use." However, in my case (and in the case of a LOT of other developers), I want to allow the user to edit notes in the app itself, in their native language, so I can't predict what glyphs they will need. If you think about it for a second, this is obvious - an InputField... allows user input. We have no way of knowing what glyphs a user is going to need.

    Without supporting either option 1 or option 2 above we get into this weird situation where we either have to...
    • Only support emojis for non-logographic writing systems (because we have to use Legacy Text for these writing systems, because we have to use TTF/OTF files, because the TMPro Font Atlas is too big) - which is hardly fair; OR
    • Increase our final build size by 30 MB just for the TMPro Font Atlases; OR
    • Not support logographic writing systems at all - for Chinese alone, this would eliminate 869 million smartphone users
     
    Last edited: Sep 10, 2023
  8. victornor

    victornor

    Joined:
    Jan 17, 2014
    Posts:
    88
    How is this still an issue? Unity please fix your core features.
    This is unacceptable...

    While the input has focus, it's impossible to move the caret.
    Only way to move the caret is by unfocusing and pressing the input again...
     
  9. victornor

    victornor

    Joined:
    Jan 17, 2014
    Posts:
    88
  10. melitoren

    melitoren

    Joined:
    May 13, 2020
    Posts:
    7
    Any news on when will they release a stable version with this fix?