mzubala / jquery-custom-scrollbar

189 stars 102 forks source link

All html elements selected when mouse outside #29

Closed vijay-vanecha closed 10 years ago

vijay-vanecha commented 10 years ago

'not-selectable' class and attribute 'unselectable' is added but still other html elements selected when mouse outside

mzubala commented 10 years ago

I'm not sure what you mean. Please describe it in more detail.

vijay-vanecha commented 10 years ago

I mean when i click on scroll thumb and move mouse outside of scroll bar area, all text and content on page get selected.

mzubala commented 10 years ago
  1. When you click on the thumb and move the mouse nothing is selected.
  2. When you click inside scrollable area and move the mouse content inside and outside is selected.

1 is fine. That's who native scrollbar behaves. 2 is different from native scrollbars which only select content inside the scrolled container and scroll it if you move the mouse outside the viewport. I'll think how to implement that.

vijay-vanecha commented 10 years ago

Thanks for help,

I found that this bug is reproduced only on Firefox. I am attaching image for more clarification. When i debugging i found that 'not-selectable' class and 'unselectable' attribute is already added but still all elements of page is selectable.

clphillips commented 10 years ago

To fix the select issue change.

      startMouseMoveScrolling:function (event) {
        ...
      },

to:

      startMouseMoveScrolling:function (event) {
        ...
        event.preventDefault();
      },

Additionally, .not_selectable and the attribute unselectable="on" should really be set on body not html. You can fix this in the same function, as well as in stopMouseMoveScrolling.

vijay-vanecha commented 10 years ago

It's working now. Thanks a lot clphillips & Maciej Zubala for your support.