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

Element position 'absolute' when attached to 'fixed' target #215

Open
vitto32 opened this issue Sep 21, 2016 · 2 comments
Open

Element position 'absolute' when attached to 'fixed' target #215

vitto32 opened this issue Sep 21, 2016 · 2 comments

Comments

@vitto32
Copy link

vitto32 commented Sep 21, 2016

I'm using a target with 'position : fixed' but I've noticed something strange on element positioning.
I'd expect the element position to be always fixed (as far as the target is) but:

  • when I enable it, tether sets the element position to 'absolute'
  • if I scroll the body position changes to 'fixed' (after a short while)
  • if I resize the window (or disable/enable) the position changes back to 'absolute'

On some browsers (IE, Edge, Safari) this is noticeable and annoying.
It happens also on tether.io in the examples with "click to show".

@vitto32
Copy link
Author

vitto32 commented Sep 28, 2016

The problem affects mobile browsers too (tested on Safari iPad). Page scroll affects element position. This should not happen when all the involved objects (target and constraints) have fixed position, am I wrong?

@vitto32
Copy link
Author

vitto32 commented Oct 3, 2016

All right, it seems there are 2 different problems:

  1. the move function should use fixed positioning when the target or one of his parents has fixed positioning. This fixes the problem on IE & Firefox and partially on iOS.
  2. on iOS getBoundingClientRect returns incorrect values during scrolling and resizing (when orientation is changed or navigation bar is shrank) if the target has fixed positioning. This can be solved debouncing the position function in such edge cases.

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

1 participant