Hey Guys I''ve just been debugging a weird bug with autocompleters on the site that i''m working on. I''ve only been testing in *IE* thus far but... When the *viewport is horizontally larger than the window*, i.e. you can scroll the window around, and you use the scrollbar to scroll up and down the results div, to see other options... If the viewport is scrolled to the left, and you use the scrollbar - no problem If the viewport is not scrolled to the left, ie: somewhere to the right, and you use the scrollbar, the* results div will disappear* shortly after clicking the scrollbar. I searched trac and found a few people describing similar issues but their patches looked rather complicated.. so I started reading source. In controls.js, in the onBlur function is some scrollbar related IE handling, around line 201.. but it seems broken. Specifically, it references event.clientX and event.clientY for the mouse position (event is the event object passed to the callback) I found that *changing one line* to be calls to Event.pointerX(event) and Event.pointerY(event) and the *scrolling bug completely disappears*. So that is: 201 - x = event.clientX, y = event.clientY; 201 + x = Event.pointerX(event), y = Event.pointerY(event ); It seems that the onblur event fires when you click the scrollbar, at least in IE, which causes the line setTimeout(this.hide.bind(this), 250); to get invoked, which in turn, hides the results div. Gareth --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Gareth, ive got the same problem with the scrolling dissapearing in IE, the code you mention changing - I cant seem to find it? 1.7 of scriptaculous and controls.js? or am i missing something? Cheers. On Sep 7, 9:04 am, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Guys > > I''ve just been debugging a weird bug with autocompleters on the site that > i''m working on. > > I''ve only been testing in *IE* thus far but... > > When the *viewport is horizontally larger than the window*, i.e. you can > scroll the window around, and you use the scrollbar to scroll up and down > the results div, to see other options... > > If the viewport is scrolled to the left, and you use the scrollbar - no > problem > If the viewport is not scrolled to the left, ie: somewhere to the right, and > you use the scrollbar, the* results div will disappear* shortly after > clicking the scrollbar. > > I searched trac and found a few people describing similar issues but their > patches looked rather complicated.. so I started reading source. > In controls.js, in the onBlur function is some scrollbar related IE > handling, around line 201.. but it seems broken. > Specifically, it references event.clientX and event.clientY for the mouse > position (event is the event object passed to the callback) > > I found that *changing one line* to be calls to Event.pointerX(event) and > Event.pointerY(event) and the *scrolling bug completely disappears*. > > So that is: > > 201 - x = event.clientX, y = event.clientY; > 201 + x = Event.pointerX(event), y = Event.pointerY(event > ); > > It seems that the onblur event fires when you click the scrollbar, at least > in IE, which causes the line > setTimeout(this.hide.bind(this), 250); > to get invoked, which in turn, hides the results div. > > Gareth--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Eamonn, It may have been changed in that version, I think mine was a 1.7 beta. Gareth On 10/31/07, Eamonn <eamonn.j.bell-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > Hi Gareth, ive got the same problem with the scrolling dissapearing in > IE, the code you mention changing - I cant seem to find it? 1.7 of > scriptaculous and controls.js? or am i missing something? > > Cheers. > > On Sep 7, 9:04 am, "Gareth Evans" <agr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Hey Guys > > > > I''ve just been debugging a weird bug with autocompleters on the site > that > > i''m working on. > > > > I''ve only been testing in *IE* thus far but... > > > > When the *viewport is horizontally larger than the window*, i.e. you can > > scroll the window around, and you use the scrollbar to scroll up and > down > > the results div, to see other options... > > > > If the viewport is scrolled to the left, and you use the scrollbar - no > > problem > > If the viewport is not scrolled to the left, ie: somewhere to the right, > and > > you use the scrollbar, the* results div will disappear* shortly after > > clicking the scrollbar. > > > > I searched trac and found a few people describing similar issues but > their > > patches looked rather complicated.. so I started reading source. > > In controls.js, in the onBlur function is some scrollbar related IE > > handling, around line 201.. but it seems broken. > > Specifically, it references event.clientX and event.clientY for the > mouse > > position (event is the event object passed to the callback) > > > > I found that *changing one line* to be calls to Event.pointerX(event) > and > > Event.pointerY(event) and the *scrolling bug completely disappears*. > > > > So that is: > > > > 201 - x = event.clientX, y = event.clientY; > > 201 + x = Event.pointerX(event), y = Event.pointerY > (event > > ); > > > > It seems that the onblur event fires when you click the scrollbar, at > least > > in IE, which causes the line > > setTimeout(this.hide.bind(this), 250); > > to get invoked, which in turn, hides the results div. > > > > Gareth > > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---