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

Web and WebWorks 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: 172
Registered: ‎05-01-2010
My Device: Z10
My Carrier: O2
Accepted Solution

Disable Text selection

Hi,

 

how can I prevent the text selection in a webworks application? I found a article from

 

many thanks.

 

bert

 

 



----------------------------------------------------------
find my widgets -> http://blackberry.itbert.de
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Disable Text selection

The KB article provided shows how to disable default browser behaviors by using JavaScript, specifically the preventDefault method available on each touch event.

 

You should be able to disable text selection, if you add the following JavaScript to your page. 

 

document.addEventListener("touchstart", function(e) { e.preventDefault(); }, false);
document.addEventListener("touchmove", function(e) { e.preventDefault(); }, false);

 

Note: This will also disable other behaviors that you may not wish for your application - or you may (e.g. the above code snippet will also disable scrolling and pinch-to-zoom.

 

 

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Highlighted
Regular Contributor
Posts: 68
Registered: ‎06-12-2012
My Device: Blackberry Bold 9780
My Carrier: Vodafone

Re: Disable Text selection

How do i just disable the blue selector coming up? but keep evyerthing else?

Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Disable Text selection

Are you referring to focus-mode navigation?

 

I believe the following meta tag is still supported:

<meta name="x-blackberry-defaultHoverEffect" content="false" />

 

Also see the documentation on focus navigation for more info:

https://developer.blackberry.com/html5/documentation/ww_developing/using_the_navigation_mode_1866978...

 

Finally, here are some sample apps on the topic:

http://supportforums.blackberry.com/t5/Web-and-WebWorks-Development/How-to-use-Navigation-Mode-in-a-...

 

Good luck!

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.
Regular Contributor
Posts: 68
Registered: ‎06-12-2012
My Device: Blackberry Bold 9780
My Carrier: Vodafone

Re: Disable Text selection

Sorry for the confusion,

https://www.dropbox.com/s/hgqsl7gabbte82k/2012-07-19%2009.04.37.jpg

This is what i mean , shown on the image above, i am not using focus navigation as its the playbook im using. Im trying to get rido f the blue selector on the image... Please look
Retired
Posts: 1,382
Registered: ‎07-02-2009
My Device: BlackBerry Bold 9900
My Carrier: Bell

Re: Disable Text selection

Oh I understand what you mean now.

 

You can't disable that selector.  Its part of the default virtual keyboard input mechanism for PlayBook.

Follow me on Twitter: @n_adam_stanley
-------------------------------------------------------------------------------------------------------------------------
Your app doesn't work? Use BlackBerry remote web inspector to find out why.