When the user clicks on a select
box in UIWebView
, a native popover is displayed at the bottom of the screen with the available options. The webpage contents scroll up to make room for this popover.
It seems like no DOM event is fired when this scroll happens, although the value of body.scrollTop
does change. Is there any way to detect when the popover is opened, or do we have to use setInterval
to poll and watch for scrollTop
changing?
I'm surprised that the scroll event isn't firing. MDN has a list of events that can be bound to that might be of help to you.
A quick thought that jumps out to me is that you could bind to the mouseup and input/change events on the select and in their callbacks determine what the scrollTop is as the user interacts with the select. If you have multiple selects you need to track, you could delegate the events to the body to avoid creating additional listeners.
Polling would work, but it'd be a lot less efficient then adding a few event listeners on the select itself, so hopefully you can find an event that works.
Hope that helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With