Skip to content

Loading…

Element picker overlay on yahoo.com #344

Closed
pwstokes225 opened this Issue · 5 comments

3 participants

@pwstokes225

The overlay does not appear to cover the top of the page where the logo and search box are located.

This seems to occur specifically on https://au.yahoo.com/, https://hk.yahoo.com/ and https://nz.yahoo.com/.

@gorhill

I will note my observation here before I forget:

  • The body has a top margin of 89px. Since the element picker installs itself as a child of the body, it is being pushed down by that margin. Solution: set the svg element position to fixed.
  • The offsetTop of the body is 0, meaning the mouse pointer mapping is offset. Solution: query the client bounding rect for the body element and offset according the top value (this may also solve other mapping issues reported somewhere else).
@Deathamns

@gorhill Just for the record, I've made some changes to the element picker in my ports branch, and unintentionally fixed these issues. If you don't want to bother...

@gorhill

@Deathamns Are you referring to the use of Element.getBoundingClientRect() rather than offset[Something]?

@Deathamns

That probably solved the offset issue, the top margin for the body is fixed by adding the pickerRoot to the documentElement instead of the body element.

@gorhill gorhill added a commit that closed this issue
@gorhill gorhill this fixes #344 86f1cb0
@gorhill gorhill closed this in 86f1cb0
@gorhill

@Deathamns Your fix works very well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.