Editbox placeholder(textview) moves down or up when we click outside editbox

I’m not entirely sure what you’re trying to achieve within the event listeners, but is there any reason you didn’t call setPasswordEnabled(true) on the text field. Like this:

editbox2->setPasswordEnabled(true);

yes… if i call setPasswordEnabled(true)… i am getting problem shown in below GIF… watch FULL GIF you will get it

when I setPasswordEnabled(false) text field change it position and revers too

that’s why i have implemented my own pasword method … so now i have only one problem and that’s that cursor shows up in the middle even though i have set anchor point left

below GIF IS Before i have set my own password method inlistner now after setting up password method in listener i am having only one problem that is about cursor

Oh I get what you mean now, so you use it to show or hide the password when the user clicks on the eye symbol.

Can you try something? Call this method every time you want to change the visibility of the text, and see if it helps. Make sure you disable all the code you have in the event handlers you pasted above so they don’t mess with it.

void ShowPassword(bool state)
{
    auto currentText = editbox2->getString();
    editbox2->setPasswordEnabled(state);
    editbox2->setString("");
    editbox2->setString(currentText);
}

Let me know if it works.

okay let try… I will let you know… I am sorry i am having some android studio problem so i will let you know as soon as i run it :slight_smile:

thanks… it’s working, Now no need to implement own password logic, but still i have that cursor problem it shows off to the middle of text field until we start typing even though we have set Anchor point left

You may need to log an issue on the tracker regarding the cursor problem:

Have you tried to run the cpp-tests app to see if that issue occurs there too? It has the UI test section in there.

i have created issues there

someone told me about that test thing and i have tried that and not working can you send me link or something so I can check that it is same that you are telling me and that person sent me. By the way do you have discord or something like that I am in one cocos2dx discord server but it is like dead

Find your Cocos2dx installation, and go into the \tests\cpp-tests\ folder, and load up whichever project you want to compile. The Android Studio project is in

\tests\cpp-tests\proj.android

The Windows Visual Studio project is in:

\tests\cpp-tests\proj.win32

As for Discord, I didn’t even know there was a Discord server for Cocos2d-x, but for me personally it’s not something I would use to discuss issues, as they’re better left on this forum.

okay, I am going to try this test thing…thanks again, yeah there is discord server but not officially :slight_smile: by the one more problem is there. when you press backspace it will remove one by one character and that is expected but when it deletes all character and one more time you hit backspace button and it gives an error and stops working

E/SpannableStringBuilder: SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length
SPAN_EXCLUSIVE_EXCLUSIVE spans cannot have a zero length

I found workaround it but I thought I just let you know if you find the solution about editbox or cursor please let me know

I wouldn’t know what would be causing that, since I neither use the component nor know the code associated with it. Perhaps someone else here can help with that specific issue.

ohh okay, in editbox everything work fine just one issues and that is that moving thing :slight_smile: i hope it fix soon

Someone will take a look at the Github issue.

Also, if you have multiple questions, please post one per topic. You asked a few questions here and it makes it hard to know what you have solved and what isn’t.

Also, no need to go to other topics saying people aren’t helping you. It also clutters those topics.

okay…I won’t go to other topics and I will open a new topic for each problem…

in here, I have asked two question, none of this is solved

  1. about editbox : editbox placeholder change its position when it gets in focus and when it loses focus, how do we have normal editbox so it looks good rather than like in below GIF

  1. about Textfield : text field shows cursor in the middle when it gets focus even though we have set Anchor point left, right or any. it moves it right postion(according to anchor point) when you start typing.

you can see it in below GIF

And about GitHub, It’s been four days and no one even replies that we are working on it or not even anyone watched my Issues or participated and some other issues that have been posted after mine they are being replied, so it’s kind of wired, so I hope they are working on it or at least they have noticed the editbox and textfield issues.

We can ask @drelaptop to take a look. I know he is working on tasks and also there is a holiday starting in a few days.

@drelaptop there are a few .gifs in this thread that show the issue and here is the GitHub issue

okay, so we can ask the question to drelaptop, thanks. yeah I guess you are right, because of the holiday may be no one reply :slightly_smiling_face:

@parth3535 The team responds to issues as they can in their workload. They have a lot of work to do and probably never enough time to get it all done :slight_smile: We all have jobs so we know what it is like to be busy. Thank you for your patience and feel free to ping me if you need follow-up.

yeah you are right :slight_smile: no problem, and thanks, I will ping you

@slackmoehrle @drelaptop hi did you get any update for this post… i really need some solution for this one.

The team is very busy. Perhaps @drelaptop can help soon.

@slackmoehrle
it’s been over a month and it seems like no one even care about this issues.