0

I created an example here. I created a directive that binds to the scroll event and puts the directive in a select. However, the scroll event never fires!

I also created a jquery version and it works!. Can some one tell me how to listen to a scroll event of select and ng-options? Thanks!

0

1 Answer 1

0

Just copied style

style="overflow:scroll" size=5

from your second select and pasted in your first select, and it worked.

<select ng-model="n" ng-options="number for number in users" scrolly style="overflow:scroll" size=5>
  <option value="">--pick a number--</option>
</select>

This post could have helped you:Scroll event is not fired inside directive - angular.js

See the screenshot, the code example you created is working in chrome. enter image description here

Sign up to request clarification or add additional context in comments.

2 Comments

I think it is a bug of chrome. I tested the exact same code with FireFox and it works fine. Your code works but I prefer to have the same style as of ng-select. I tried to change the size to 1 and it won't work.
I think you need to do some research here. See the screenshot, the code example you created is working in chrome with those changes. Look at the post link in my answer, you might get some help there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.