[wp-trac] [WordPress Trac] #37536: Twenty Fifteen: Improve sticky sidebar logic.

WordPress Trac noreply at wordpress.org
Mon Aug 1 10:46:51 UTC 2016


#37536: Twenty Fifteen: Improve sticky sidebar logic.
---------------------------+-----------------------------
 Reporter:  DvanKooten     |      Owner:
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Bundled Theme  |    Version:  trunk
 Severity:  normal         |   Keywords:
  Focuses:  javascript     |
---------------------------+-----------------------------
 The current logic in TwentyFifteen (#30366) for making the sidebar sticky
 while still allowing to scroll through it when the sidebar height is
 larger than the viewport height is flawed and massively overcomplicated.

 This results in buggy behaviour when third-party code (in plugins) add
 body padding, for example.

 '''Steps to reproduce buggy behavior:'''

 {{{#!php
 <?php
 add_action( 'wp_footer', function() {
    echo "<script>document.body.style.paddingTop = '50px';</script>";
 });
 }}}

 Basically any plugin that implements admin bar like behavior will cause
 problems, with the sidebar thinking it has to apply a top offset where it
 actually doesn't have to do anything.

 This can be mitigated by removing the admin bar specific logic and leaving
 most of the heavy lifting up to the browser.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37536>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list