Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


Reply
Developer
Posts: 68
Registered: ‎11-12-2013
My Device: Z10
My Carrier: Rogers
Accepted Solution

Cursor (caret) not displaying in text area after insert of text or position change

I have managed to change the cursor position in a TextArea in both qml and C++ using through the editor associated with the drop down.

 

I verified the change by getting cursor, changing position and getting position again.

 

However, the cursor does not display or is not visible in the TextArea. When I tap on the screen the cursor reappears.

 

The cursor disappears when I insert text at the cursor position.

 

Any idea why or how to control visibilty of cursor in this situation.

 

I know you probaably want to see the source code here it is

 

  textArea.editor.insertPlainText("plain text");

 

 

Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Cursor (caret) not displaying in text area after insert of text or position change

Hi,

 

The cursor/caret isn't visible unless the TextArea is focused. Does code like this work for you?

 

        TextArea {
            id: ta
        }
        Button {
            text: "Click Me";
            onClicked: {
                ta.editor.insertPlainText("plainText");
                ta.requestFocus();
            }
        }

 Thanks.

 

--
Rob is no longer associated with BlackBerry.
Developer
Posts: 68
Registered: ‎11-12-2013
My Device: Z10
My Carrier: Rogers

Re: Cursor (caret) not displaying in text area after insert of text or position change

That was it, thanks! Tested both in QML and C++.

 

Works the way I want. I insert text and then position curso within the text where user needs to type

Highlighted
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Cursor (caret) not displaying in text area after insert of text or position change

Glad to hear it! Good luck with your app!

--
Rob is no longer associated with BlackBerry.