Can't move the carret on a selected inputfield

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)

obeseimpracticalibizanhound

I have found no answer on the web…

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

            //else if (m_HideMobileInput) // m_Keyboard.canSetSelection
            //{
            //    int length = stringPositionInternal < stringSelectPositionInternal ? stringSelectPositionInternal - stringPositionInternal : stringPositionInternal - stringSelectPositionInternal;
            //    m_SoftKeyboard.selection = new RangeInt(stringPositionInternal < stringSelectPositionInternal ? stringPositionInternal : stringSelectPositionInternal, length);
            //}
            //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.

So i won’t get any answer from the dev who are working on TextMeshPro ? It’s really a bug that should be fixed…

up

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?

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.

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).

1 Like

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…

  • 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
  • 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

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…

1 Like

It turns out that this has been fixed. But the version with this fix was not available from the package manager.
Download and import it manually from here GitHub - needle-mirror/com.unity.textmeshpro: [Mirrored from UPM, not affiliated with Unity Technologies.] 📦 TextMeshPro is the ultimate text solution for Unity. Its the perfect replacement for Unitys UI Text and the legacy Text Mesh.Powerful and easy to use, TextMeshPro (also known as TMP) uses Advanced Text Rendering techniques along with a set of custom shaders; delivering substantial visual quality improvements while giving users incredible flexibility when it comes to text styling and texturing.TextMeshPro provides Improved Control over text formatting and layout with features like character, word, line and paragraph spacing, kerning, justified text, Links, over 30 Rich Text Tags available, support for Multi Font & Sprites, Custom Styles and more.Great performance. Since the geometry created by TextMeshPro uses two triangles per character just like Unitys text components, this improved visual quality and flexibility comes at no additional performance cost.UPGRADE NOTE--------------------This latest release of the TMP package includes updated TMP Essential Resources and TMP Examples & Extras. Be sure to update those via the "Window - TextMeshPro - Import..." menu options.
And make sure that “OnFocus - Select All” is disabled.

1 Like

Any news on when will they release a stable version with this fix?