简体   繁体   中英

Android cursor jumping on deleting text kotlin

The issue I am running into is that I have a numeric Edit Text field where the cursor drives me crazy:

Let's say you want to type 11115 but mistype 11116. The "normal" behavior should be to hit backspace and then type 5.

What is happening though is that after the backspace, the cursor jumps to the front of the 1, and has to be re-positioned to the end of the remaining "1111" string.

More precisely: Regardless where in the string I delete a number, the cursor always jumps to the front after delete.

I can envision all kinds of workarounds with storing and restoring the cursor position... but there has to be a better way.

I figured it out... I was refreshing that field (which is a bug) after the delete... That reset the cursor.

Thanks for your answers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM