-1

I have set up a mmenu plugin that enables you to slide swipe menus at the sides, but it makes my content text unable to be selected / highlighted.

Do you guys have any suggestion how I can debug or trace the code if issues like this persist?

I tried checking if there are CSS styles like the following,

html, body{
    user-select:none;
    MozUserSelect:none;
    webkitUserSelect: none;
}

but no, it doesnt have anything like that..

What im trying to say, if it is caused by the plugin, how do you find the code that makes it unselectable? because im pretty sure the author of the plugin did not use that CSS because I could not see a CSS code like that.

Plugin URL: https://github.com/BeSite/jQuery.mmenu extends Hammer plugin: http://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.5/jquery.hammer.js

user2567536
  • 237
  • 1
  • 2
  • 13
  • I always used `-webkit-user-select: none` (because that is the correct way to do it, unlike yours). – Ryan May 27 '14 at 04:00
  • What im trying to say, if it is caused by the plugin, how do you find the code that makes it unselectable? because im pretty sure its not using that CSS because I could not see a CSS code like that. – user2567536 May 27 '14 at 04:06

4 Answers4

1

Use like this instead:

html, body{
    -moz-user-select: all !important;
    -webkit-user-select: all !important;
    user-select: all !important; // call it at last for better use
}
Bhojendra Rauniyar
  • 83,432
  • 35
  • 168
  • 231
  • What im trying to say, if it is caused by the plugin, how do you find the code that makes it unselectable? because im pretty sure the author of the plugin did not use that CSS because I could not see a CSS code like that. – user2567536 May 27 '14 at 04:07
  • you should look into the js file of the plugin and what you actually want to do ? – Bhojendra Rauniyar May 27 '14 at 04:12
  • the plugin is making the content of my page unselectable/unhighlitagble. all text cannot be highlighted/selected if user want to copy a quote inside my site. this is the src of the plugin https://github.com/BeSite/jQuery.mmenu/blob/master/src/js/jquery.mmenu.js and there is no user-select keyword to be found – user2567536 May 27 '14 at 04:17
  • still not working. maybe there is an event that makes selecting preventDefault() ? – user2567536 May 27 '14 at 05:18
  • preventDefault() is no sense for css..... should work... but amazed that not work... did you clear the browser cache? – Bhojendra Rauniyar May 27 '14 at 05:30
  • clearly it was a script that prevented it so that the side swipe wont confuse with text selection and hold/swipe page. it has a js-generate css – user2567536 May 27 '14 at 08:42
0

Use chrome and right click the test, and choose inspect element. Now look at the computed styles and see if there is anything weird going on.

If not, another option to explore is if there is any strange javascript effecting your clicking etc (although I'm not entirely sure this is possible to this level).

Nick M
  • 1,647
  • 13
  • 17
0

Reading and finding problems of a plugin is very hard..
because it's author wrote it in his own way..
But I think this is another problem ..
may any elements Like <div>, <span> May positioned above the text,,
So You can't Select the text,,

1 ) Please open the site in Chrome..
2) And right click on the text,,
3) Select Inspect element..
4) In the new open window , check if the element which text contains is selected
if it is not selected, another element still above the text


Or do one,, Upload the webpage to internet , and paste the url here

  • Thank you for your suggestion but there is nothing on top of the text. even the cursor will change to a "text" cursor if it is on top of the text.. but just cannot start highlighting them.. – user2567536 May 27 '14 at 05:07
  • 1
    I realized it is more on based in hammer script since it is a pre-req of the plugin.. http://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.5/jquery.hammer.js .. I guess I should look more on the defaults of this plugin right? I can seem to understand how to modify defaults/settings when he called hammer plugin – user2567536 May 27 '14 at 05:22
0

I found where the userSelect none was set. It is in the hammer plugin which the mmenu plugin extend.. http://cdnjs.cloudflare.com/ajax/libs/hammer.js/1.0.5/jquery.hammer.js

I have reset the hammer defaults:

from

userSelect:"none",touchAction:"none",touchCallout:"none",contentZooming:"none",userDrag:"none"

to

userSelect:"",touchAction:"",touchCallout:"",contentZooming:"",userDrag:""

I have reset it in the plugin itself because if you reset it in javascript after instantiating the pluign, it wont still work

user2567536
  • 237
  • 1
  • 2
  • 13