Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overlay does not work as expected #17

Open
nalexiou opened this issue Dec 22, 2014 · 7 comments
Open

Overlay does not work as expected #17

nalexiou opened this issue Dec 22, 2014 · 7 comments

Comments

@nalexiou
Copy link

Hi Hector,
I attempted to use Focusable on http://www.coupons.com. When I focus on an element while at the top of the page, focusable works fine. However, if I scroll down and then attempt to focus on an element on that section of the page, the overlay does not cover that part of page. I am suspecting it has something to do with the heights of of the columns? If you can take a look, that would be great!

Thank you.
Nick

@zzarcon
Copy link
Owner

zzarcon commented Dec 22, 2014

Hi @nalexiou thanks for your time, the thing is that when Focusable it's enabled, we make the overflow of the body to hidden, by this way the user can't perform a scroll in the web (at least this is the approach of the lib).

The columns grows vertically and their height it's equal to the window height. So if you can perform a scroll in your site, probably was a bug of the lib.

Can you please put here the steps to reproduce the bug? show me what element are you trying to set focus here http://www.coupons.com and I'll try to reproduce and fixe it.

Thanks!

@nalexiou
Copy link
Author

Hi Hector,

Thank you for looking at this issue so quickly. So, this is what I do to get the get to the issue:

  1. Visit www.coupons.com
  2. Inject your jquery abnd infocus-element-overlay.min.js into the site.
  3. Scroll down a little bit on the page.
  4. Focus on the first coupon item (Chex Mix offer of the week) using Focusable.setFocus($('[data-podid="18473147"]'));

As you can see from the screenshot, the overlay does not extend all the way do - it gets cut off. I have no issue the overflow:hidden part, that is, I do not need the page to be scrollable while the item is focused.

screen shot 2014-12-22 at 2 54 26 pm

Here is also a snapshot of html code for the overlay while focusing on the item:

screen shot 2014-12-22 at 3 01 38 pm

Does this help?

Thank you.
@nalexiou

@zzarcon
Copy link
Owner

zzarcon commented Dec 23, 2014

Ey man thanks you so much for the detailed issue and images, I'll work to fix it as soon as posible. I'll ping you with the fix! Thanks

@zzarcon
Copy link
Owner

zzarcon commented Dec 23, 2014

I just tested a bit the issue in your page and noticed that is related with the offset of the current element... It's because is calculated relative to the entire document instead of the visible part (window) so later I'll try to fix it ;)

@nalexiou
Copy link
Author

You're welcome Hector. Glad to know this helped. Looking forward to the fix.

Nick

On Dec 23, 2014, at 4:38 AM, Hector Leon Zarco Garcia notifications@github.com wrote:

I just tested a bit the issue in your page and noticed that is related with the offset of the current element... It's because is calculated relative to the entire document instead of the visible part (window) so later I'll try to fix it ;)


Reply to this email directly or view it on GitHub.

@jejung
Copy link

jejung commented Feb 26, 2016

Hi all, I had the same issue. I created a solution, testing it at the moment. Check this commit jejung@f9bfba0. Untill now it's required to wait the scroll animation ends and then focus the element.

@jejung
Copy link

jejung commented Feb 26, 2016

Added pull request #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants