Here’s the simplified html:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function handle() { console.log("fired"); };
</script>
</head>
<body>
<div style="width:200px; height:100px; overflow-y: scroll; border: 1px solid gray;" onscroll="handle()">
<div style="width:150px; height:400px;"> </div>
</div>
</body>
</html>
The problem is, when div is not scrolled at all (initial position) the small button with triangle symbol on top of scrollbar does not fire an event. Maybe it’s logical, but I search a way to work around this behaviour, because it’s the only way for now to work around dojo framework tree widget with enabled drag-n-drop. Yep, I know, workaround for workaround.
Well, it’s not pretty, but this should do the trick:
I removed the inline function call and replaced it with an
eventListener. Basically, it makes sure the user never scrolls completely to the top or bottom, ensuring that there will always be a scroll event.