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

isInTop() Is Broken #24

Open
nickpoulos opened this issue Jul 10, 2019 · 1 comment
Open

isInTop() Is Broken #24

nickpoulos opened this issue Jul 10, 2019 · 1 comment

Comments

@nickpoulos
Copy link

nickpoulos commented Jul 10, 2019

Maybe I am missing something, but I was seeing odd behavior in that Headroom never seems to get position: relative applied? After trying to see why that was, in headroom.vue I noticed the function:

isInTop () {
      return this.state === 'pinned' || this.state === 'unpinned'
    }

Are there any other possible states besides 'pinned' or 'unpinned'? It seems this function would always return true, and therefore headroom always stays 'fixed'.

@nickpoulos
Copy link
Author

Ok, well it seems upgrading to from v9.x to v10.x fixed that particular issue, being that there is no more isInTop() function, and now position: relative is being set. But now other bizarre behavior has been introduced. The main template now includes a

wrapper with an automatic height being set with inline styles.

Using inline styles anywhere in this template is breaking faith with the original headroom in a big way because the developer loses control of how their header should look/behave.

From the headroom.js docs:

How does it work?
At it's most basic headroom.js simply adds and removes CSS classes from an element in response to a scroll event:

Relying on CSS classes affords headroom.js incredible flexibility. The choice of what to do when scrolling up or down is now entirely yours - anything you can do with CSS you can do in response to the user's scroll.

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