Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
As an admin, the block expansion and collapse works great. For my other users, expanding or collapsing blocks causes a page reload (a '#' is added to the end of the url). The blocks will expand/collapse but if the block is farther down the page, the user has to scroll back down after they expand/collapse. It would be better to have the block expand/collapse without reloading the page.
Comment | File | Size | Author |
---|---|---|---|
#30 | collapsiblock-use-preventDefault-1305364-30.patch | 647 bytes | darvanen |
#19 | collapsiblock-browser_jumps-1568036-12.patch | 797 bytes | vinmassaro |
#7 | use-preventDefault-1305364-7.patch | 641 bytes | dsdeiz |
#2 | collapsiblock.js_.patch | 465 bytes | nathanjo |
Comments
Comment #1
aaronnaylor CreditAttribution: aaronnaylor commentedI am wondering if there is any fix for this issue yet, or if one is coming soon. I love this module, but I'm not sure if I will be able to continue using it on my current project as it is. The re-scrolling issue makes the page really jumpy and it's pretty annoying... also, clicking on a link in the block causes block to collapse again (I have used CB in D6 and had no issue with it.) ... As admin, module works perfectly, when logged in as Authenticated or logged out is when issue shows up. Update please?
Comment #2
nathanjo CreditAttribution: nathanjo commentedFor some reason, the js just return href="#".
Resolved this by modifying line#29 in collapsiblock.js:
Attached patch.
Comment #3
nathanjo CreditAttribution: nathanjo commentedComment #4
essbee CreditAttribution: essbee commentedrather than this, which I find still makes the page jump around and thus doesnt provide as nice a UX. Could we instead just add
.wrapInner('<a href="#" role="link" onclick="return false;"/>')
This keeps the page position in the same place. The link isnt clickable anyway as this is hijacked by the collapsi event.
Thoughts?
Comment #5
Babymaggie CreditAttribution: Babymaggie commentedJust tried essbee's fix and I got to say it works great!
I was having the jumping screen problem so I tried the fix - Many thanks essbee
Also many thanks to the module creator - Great work!
Comment #6
gagarine CreditAttribution: gagarine commentedI guess we should use http://api.jquery.com/event.preventDefault/ instead. I don't want JS in html still if this html is dynamically created
Comment #7
dsdeiz CreditAttribution: dsdeiz commentedHi, just wondering if this would work.
Comment #8
dsdeiz CreditAttribution: dsdeiz commentedComment #9
gagarine CreditAttribution: gagarine commentedI committed suggestion from #2.
I try to move the preventDefault right after the event is fired, I'm not sure it make a difference but anyway is more readable.
So you can try the dev when is packaged and report if it works for you.
Comment #10
gagarine CreditAttribution: gagarine commentedComment #11
c4antonio CreditAttribution: c4antonio commenteddon't work with the last dev version, i have same problem, works fine only when an user is logged in, anonymous user when click on block title collapsed go on the top of page
Comment #12
xaa CreditAttribution: xaa commentedhi,
Same issue with the 7.x-1.0. and the patch from #2 is working fine.
Regarding this issue with a mobile eye, this was a major issue.
The fix is really needed for the mobile version :) many thanks
Comment #13
m.schwarzenberg CreditAttribution: m.schwarzenberg commented#4 works wonderful - thanks essbee
Comment #14
GN CreditAttribution: GN commented#4 works for me, too -
when trying, don't forget to clear cache (it may seem not working when block caching is on and your old block is still in the cache).
Thank you essbee!
Comment #15
GiorgosK@gagarine at #9
you say committed solution from #2 ?
there is no dev or official release after your post date !!
but anyone of the solutions above should work
Comment #16
GiorgosKActually #2 still creates this problem #1568036: Browser jumps to top of page when block is opened
but #7 is behaving correctly and probably solves both problems
Comment #17
GiorgosKJust to confuse the things a little more
on the same project at times #2 worked, #7 worked, but now reverted back to original .js file since patched versions were giving the same problem that were supposed to fix ??!!!
using omega 7.x 3.x subtheme if it makes any difference
Comment #18
jday CreditAttribution: jday commented#4 works for me
Comment #19
vinmassaro CreditAttribution: vinmassaro commented#4 was the only solution I found to work from this thread. I've rolled a patch against 7.x-1.x with this fix.
Comment #20
chefnelone CreditAttribution: chefnelone commentedHas been this committed to the dev version? The patch is working.
Comment #21
vinmassaro CreditAttribution: vinmassaro commented@chefnelone: Thanks for testing. Hasn't been much activity on this module, so it doesn't look like it. Moving to RTBC.
Comment #22
rCharles CreditAttribution: rCharles commentedI was getting a conflict between administration menu module and collapsiblock module when both installed (Omega 3, Bartik and other themes had "section.div" set for appearance settings). What would happen was, a # character was getting inserted into the URL (ie sitename.com/path#), and whenever a block was collapsed or expanded it would cause the page to jump to the top.
Solution:
https://drupal.org/files/use-preventDefault-1305364-7.patch
Comment #23
darvanenFor the record, the dev version available for download does not have #19 installed.
Comment #24
kopeboy CreditAttribution: kopeboy commented"Moving to RTBC" one year ago and still no patch in the dev version?!? wow
Comment #25
nevosa CreditAttribution: nevosa commented#22 solved the issue for me on 7.x-1.0.
Thanks.
Comment #26
jenniferannwalsh CreditAttribution: jenniferannwalsh commented#22 patch also worked for me 7.x-1.0. Thanks rCharles!
Comment #27
brett1 CreditAttribution: brett1 commentedPatch from #22 worked for me too (#7)
Thanks, this is a great module but the flicking up to the top of the page was effecting it.
Comment #28
kenheim CreditAttribution: kenheim commentedPatch from #22 fixed it for me. Seems like it should be ready for a commit.
Comment #29
fitzed CreditAttribution: fitzed commentedPatch from #22 worked for me too. Thank you!
Comment #30
darvanenRerolled #7/#22 patch on current dev release for test queue.
Comment #31
System Lord CreditAttribution: System Lord commented#22 worked for me. I only noticed it on my android and now it's fixed. Thank you!
Btw..something is strange. Patch at #22 looks like this:
Patch #30 looks like this:
If both are for DEV why are they different?
Also, Darvanen, unless i dont understand what "rerolled" means should that have updated the DEV date/version and been listed in the "view commits"? Is this thread the "test queue" ? Not griping. Just trying to understand.
Comment #32
darvanenHi @System Lord,
They're different because patch #22 was made for an old version of the dev branch. That is, the dev branch has had some changes made and committed since #22. This means when you try to use the patch it works, but it doesn't give the patch program exactly what it is expecting, and the automatic patch testing system doesn't like that.
Note that on https://www.drupal.org/node/332678 it states:
So I 'rerolled' it (basically just opened the dev branch at its current commit state and ran the patch) in order to make it test properly, and to make it slightly easier to commit for the maintainers.
Seems it hasn't been queued for testing yet, I'm not sure why.
Comment #33
System Lord CreditAttribution: System Lord commentedUnderstood, darvanen...thanks!
Comment #34
gagarine CreditAttribution: gagarine as a volunteer commentedcommited
Comment #37
semanthis CreditAttribution: semanthis commentedProblem still appears in 8.x-2.0.
e.preventDefault(); fixes the problem there es well.