#37536 closed defect (bug) (fixed)
Twenty Fifteen: Improve sticky sidebar logic.
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Bundled Theme | Keywords: | bulk-reopened has-patch commit |
Focuses: | javascript | Cc: |
Description
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 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.
Attachments (4)
Change History (13)
#3
@
8 years ago
@DvanKooten do you have an example of a plugin that does this? I would like to test in a real case over outputting code to footer.
#7
@
6 years ago
- Keywords bulk-reopened has-patch added; reporter-feedback removed
- Milestone set to 5.3
I tested this issue using the APEX NOTIFICATION BAR LITE
plugin in the .org repo https://wordpress.org/plugins/apex-notification-bar-lite/
The issue still exists in Twenty Fifteen and the most recent patch 37536.2.2.diff does seem to fix it, with no adverse effects. Going to tag this for the 5.3
milestone. Been tested on Windows machine in Chrome, Firefox, IE11 and Edge.
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
#9
@
5 years ago
- Keywords commit added
Patch is still good. Was able to reproduce in Twenty Fourteen and verify that that latest patch caused no ill side effects.
Fix non-stickiness for small sidebars.