Skip to content

Conversation

@roby124
Copy link

@roby124 roby124 commented Apr 10, 2018

Elements with CSS property position set to absolute are incorrectly positioned after ng-sticky gets deactivated if top attribute is different than 0.
This is due to the fact that removeSticky() method leaves top property active on previously stickied element (only position property gets removed on deactivation - this.el.nativeElement.style.position = '';).

Example:
Element which holds ng-sticky directive has the following CSS:

position: absolute;
top: 30px;

After sticky deactivation, top property stays active and is set to 0 which places the element in a wrong place.

This pull request solves the problem by removing the whole style attribute upon sticky deactivation.

@vovank86
Copy link

vovank86 commented Jun 20, 2018

I absolutely agree with roby124. This fix is very important for me.
As temporary fix I use !important in my css, but it's wrong way.

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

Successfully merging this pull request may close these issues.

2 participants