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

Create helper for sticky positioning #474

Closed
jraadt opened this issue May 19, 2016 · 36 comments
Closed

Create helper for sticky positioning #474

jraadt opened this issue May 19, 2016 · 36 comments
Labels
design This issue needs design work before implementing feature This issue represents a new feature or feature request rather than a bug or bug fix intern project! This issue is part of an intern project! https://careers.google.com/students/

Comments

@jraadt
Copy link

jraadt commented May 19, 2016

  • Do you want to request a feature or report a bug?
    feature
  • What is the current behavior?
    There is no $mdSticky for components like md-subheader inside a md-list.
  • What is the expected behavior?
    I would expect a service like $mdSticky from Material v1 to allow components like md-subheader inside a md-list to stick when scrolling.
  • What is the motivation / use case for changing the behavior?
    To provide the same functionality that is present in Material v1.
@jelbourn jelbourn added the feature This issue represents a new feature or feature request rather than a bug or bug fix label May 19, 2016
@jelbourn jelbourn changed the title Add $mdSticky service to create sticky subheaders and other components. Create helper for sticky positioning May 19, 2016
@jelbourn jelbourn added design This issue needs design work before implementing toolkit labels May 19, 2016
@devversion
Copy link
Member

Once this feature will be added, we should test that really thoroughly.

  • The current implementation in Material 1, is shaking on several touch devices / browsers.

It should also check, if the current browser supports sticky positions natively.

@rolandjitsu
Copy link

At least the toolbars should be something we can make sticky. It does look much better when the toolbar is always at the top while you scroll the content (in some cases).

@jefferson-willian
Copy link

@rolandjitsu actually you can do that with layouts. Just use two columns, one for the toolbar and another for a scrollable content. It would be something like that:

<div layout="row">
  <div layout="column" layout-fill>
    <md-toolbar>
      <div class="md-toolbar-tools">
        <h3>
          <span>Title</span>
        </h3>
      </div>
    </md-toolbar>
    <md-content flex>
    </md-content>
  </div>
</div>

@btroncone
Copy link

Any update or examples of this in practice? This would be a very helpful addition as the majority of MD layouts utilize a sticky header by default. 👍

@devversion
Copy link
Member

@btroncone Thanks for the reminder. This feature hasn't been marked as a high priority for the beta, but I will try to look into it soon - Here is my (pretty old) proposal for this feature.

@devversion devversion self-assigned this Jan 10, 2017
@btroncone
Copy link

That would be amazing, thanks for the feedback and quick response! 👍

@trainerbill
Copy link

Would this be better implemented in flex-layout?

@devversion
Copy link
Member

devversion commented Jan 11, 2017

@trainerbill I don't think that you can categorize this into flex-layout

As from the name, flex-layout is a set of directives to build a layout using Flexbox CSS - It should be part of Angular Material's component toolkit.

@devversion devversion removed their assignment Feb 24, 2017
@f-mon
Copy link

f-mon commented Mar 19, 2017

will this feature be implemented?

@ashishdoneriya
Copy link

1 year and still open

@devversion
Copy link
Member

devversion commented May 22, 2017

@ashishdoneriya We are still in beta and other components have bigger priorities right now. This issue is just here for tracking.

@jelbourn jelbourn added the intern project! This issue is part of an intern project! https://careers.google.com/students/ label Jun 2, 2017
@jofftiquez
Copy link

Guys what happened to the "This feature will be added"? :( I'm thinking of switching to Vue coz of it's material framework. Material 2 should be updated.

@ashishdoneriya
Copy link

Nice idea @jofftiquez . Thanks

@mackelito
Copy link

Has anyone tried out this? https://github.com/google/angular-sticky-element

@antonyRoberts
Copy link

@jelbourn and @kara. Has, there been any movement on this? It looks like the intern who was assigned to this, is no longer working on it.

@reppners
Copy link

reppners commented Dec 8, 2017

Need to make a decision on a project wether to put effort into implementing sticky headers/look for an alternate implementation or wait on implementation in CDK/Material.

Is there any ETA or status on this feature that can help make this decision?

@pmsa29
Copy link

pmsa29 commented Jan 15, 2018

Where can I see the progress of this sticky-header, also is there a way to do master-detail?

@ashishdoneriya
Copy link

ashishdoneriya commented Jan 16, 2018

I think there is a special team for thumbs down every comment which is not in favour of material2.

@mackelito
Copy link

mackelito commented Feb 5, 2018

@jelbourn Is the sticky header in latest? (would love to test it out) :)

@tomgruszowski
Copy link

tomgruszowski commented Mar 29, 2018

@mackelito given the issue backlog is 800+ long, I don't think this team has the bandwidth for anything but bugfixes. I still use bootstrap to complement my UIs as ng-material is severely lacking on so many things. The toolbar on the demo site is mostly custom code.

@mackelito
Copy link

@tomgruszowski sure.. but alot of the issues are P4's, several has PR's already etc etc.. It's not a surprise when a framework has this userbase ;)

@tomgruszowski
Copy link

I'm not going to lie, I wish this project moved way faster, but I'm sure they have their reasons. I think it's a pretty small team and many of them are fairly recent hires. Is AngularJS Material team still doing their own thing or have they all moved over?

@odahcam
Copy link
Contributor

odahcam commented Apr 27, 2018

Wouldn't Popper.js be as useful as Hammer?

@michaeljota
Copy link

@odahcam Oh! God no... Please, just don't use Popper.JS. I'm sure it's great, but it's a real pain to integrate it with Angular. And I ain't sure how this could be integrated for this task.

@jofftiquez
Copy link

Wow I didn't know I got downvoted so hard on this thread hahahaha. There should be a notification for this. Guys! Switch to VueJs! It's better!

I'm kidding of course 😀 Enjoy the breaking changes! 🎆 😛

@odahcam
Copy link
Contributor

odahcam commented May 25, 2018

Why not to just use position: sticky with some JS sticky polyfill?

@reppners
Copy link

reppners commented Jun 1, 2018

As @odahcam points out recent browsers have sufficient support for position: sticky so this feature can be implemented quite easily.

Necessary styles:

.sticky-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
}

Personally I don't need to support ancient browsers that are not capable of doing it with pure css so no fancy JS polyfilling needed.

@pppdns
Copy link

pppdns commented Jun 1, 2018

Currently 14% from the global browser usage doesn't support position: sticky, most of them are 5 years old versions (e.g. IE11 from 2013)
https://caniuse.com/#search=sticky

image

@odahcam
Copy link
Contributor

odahcam commented Jun 1, 2018

On the other side, I think this sticker helper may aim to add that behavior we see in mobile Chrome app bar that hides and shows up on scroll. 🤔

@jeremyputeaux
Copy link

jeremyputeaux commented Jun 1, 2018 via email

@michaeljota
Copy link

Angular should work with IE11 so I don't think this will be an actual option for the team. display: sticky only works out the box properly in 5% of the browsers. So even if they didn't have to support IE11, I don't think this is the way to go.

Regardless the scroll behavior, I think this could be easy doable with an scroll event, just changing the position of the sticky component.

@gangsthub
Copy link

is this issue closed by #11483?

@odahcam
Copy link
Contributor

odahcam commented Jun 27, 2018

@michaeljota

Regardless the scroll behavior, I think this could be easy doable with an scroll event, just changing the position of the sticky component.

This certainty would be easy and awesome if it comes with the helper, would be from a great help.

@jelbourn
Copy link
Member

jelbourn commented Oct 5, 2018

Closing this since there are no plans to add this feature. We believe that using the native position: sticky is the best approach moving forward.

@jelbourn jelbourn closed this as completed Oct 5, 2018
@odahcam
Copy link
Contributor

odahcam commented Oct 5, 2018

As most of sticky positioned stuff is all about layout and does not blocks users of doing anything if it don't work and we have 85% of global support for this feature, I think you'r right.

Here's the current support status BTW:

image

andrewseguin pushed a commit to andrewseguin/components that referenced this issue Oct 15, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
design This issue needs design work before implementing feature This issue represents a new feature or feature request rather than a bug or bug fix intern project! This issue is part of an intern project! https://careers.google.com/students/
Projects
None yet
Development

No branches or pull requests