Closed (won't fix)
Project:
Bootstrap
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Dec 2013 at 13:35 UTC
Updated:
7 Apr 2015 at 09:22 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
simon georges commentedAll credits for this patch goes to Grsmto.
Comment #2
simon georges commented(It seems to prevent linking to another page with an anchor as well, see for example permalinks on node comments).
Comment #3
avo webworks commentedThe patch above works wonderfully thank you.
Comment #4
simon georges commentedComment #5
JadH commentedPatch worked for me also
Comment #6
markhalliwellThanks @simongeorges!
Committed 638f919 to 7.x-3.x:
Comment #7
markhalliwellComment #9
dagomar commentedCould someone explain why we need that functionality in the first place? It doesn't seem to be part of bootstrap to begin with, and it interferes with all links to anchors, also the ones that some modules, like the media field, rely on.
Comment #10
markhalliwellWhen a fixed navbar or some sort of fixed menu (admin_menu) is present, it overlays the actual position of the anchor clicked. It's a simple setting that can be disabled if it's really "interferes" with your design.
Comment #11
dagomar commentedHi Mark,
thanks so much for yor reply! I completely overlooked that it's possible to turn that feature off. However, if I or anyone else wants to use it, perhaps there should be a way to influence the selector?
Thanks again,
Dagomar
Comment #13
markhalliwellI'm just moving this back to 7.x. If this needs re-evaluation in 8.x, create a new issue.
Comment #14
kopeboyI am sorry to reopen this but I cannot use the feature at all with anchor links. Anchor links work only if I disable "Fix anchor position", but disabling that hides the scrolling functionality as well. So what is the rationale of this feature at all? I don't get it.
What is the problem causing anchor links not to work when "Fix anchor position" is enabled?
Using fresh install site with latest core, jquery 10 (with jquery update) and anchor links in a menu with #anchor and anchors either with name or ids.
Everything works properly when I disable the feature but of course I would like the smooth scrolling functionality. I tried other modules for that too but no one seems to work :(
Comment #15
kopeboyComment #16
donquixote commentedThis caused some confusion with Gallery formatter:
#2274693: Undesired scrolling, if used in combination with Bootstrap theme.
I think the problem is that the "fix" is only meant for anchors that work as regular links, but it also affects anchor links that already have a click behavior attached, and where the regular link action is suppressed.
Yes, it can be turned off. But it would be preferable to find a solution that only affects the links we actually care about.
Or otherwise make this opt-in.
Comment #17
Konstantin Komelin commentedThe anchorBehvior should probably compare url paths and not only anchors #2343539: bootstrapAnchor does not check if URLs are different
Comment #18
chrissnyderScrollTo is a little aggressive, in order to prevent issues with jquery ui date popup i had to change the following:
Comment #19
klokie commentedI just ran into this issue as well. Seems to me that the jQuery selector that matches the URL fragment should be
a[href^="#"]– i.e. URL starts with a hash mark – rather thana[href*="#"]– i.e. URL contains a hash mark at any position. That should prevent this unwanted behavior on links to other pages (and may also help with #2343539: bootstrapAnchor does not check if URLs are different), though it probably won't fix the conflicts with other modules like Gallery formatter or Date.Comment #21
markhalliwellClosing in favor of #2462645: Create @BootstrapPlugin for "bootstrap-anchor".
Marking as "won't fix", because any solution(s) provided here is against the current code. This will be replaced with http://markcarver.github.io/bootstrap-anchor/ instead.