Skip to content
This repository has been archived by the owner on Oct 2, 2019. It is now read-only.

Prevent whole page scroll when scrolling ui-choices #940

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

emmanueldaher
Copy link

Prevent the browser's annoying default behavior of scroll the whole page
when scrolling in ui-choices options, useful when it has many
options, changeable in uiSelectConfig globals and preventPageScroll attribute.

Emmanuel L. Daher added 2 commits May 18, 2015 13:24
Prevent the anoying default browser behavior of scrolling the whole page
when scrolling in ui-choices options, usefull when it has lots of
options, and changeble in uiSelectConfig and preventPageScroll attr.
default value for preventPageScroll config option.
@@ -47,6 +47,18 @@ uis.directive('uiSelectChoices',
if (rowsInner.length !== 1) throw uiSelectMinErr('rows', "Expected 1 .ui-select-choices-row-inner but got '{0}'.", rowsInner.length);
rowsInner.attr('uis-transclude-append', ''); //Adding uisTranscludeAppend directive to row element after choices element has ngRepeat

if ($select.preventPageScroll) {// Prevent the whole page for scrolling when the choices ul reaches it's scroll limits.
element.bind('mousewheel', function(event) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to element.on

@dorrotman
Copy link

While this was not merged, I used this code in an angular directive that applies by the class name of the dropdown list container, and it helped me a lot.
Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants