You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an issue that with the widget kartik-v/yii2-tabs-x/ for yii2 which uses jquery-stickytabs.
Whenever you click a tab with a normal href link (so another page is requested on tab click) #undefined is added to the current url before the actual given url of the href is requested.
I have already opened an issue there today but i think is a more on an issue of this package.
See: kartik-v/yii2-tabs-x#66
The problem is that there isn't any check if the some hash is actually given.
And because of this #undefined is added if no anchor is used in the url.
This code:
$('a', context).on('click', function(e) {
var hash = this.href.split('#')[1];
var adjustedhash = settings.getHashCallback(hash, this);
changeHash(adjustedhash);
setTimeout(backToTop, 1);
});
doesn't check if the hash is undefined or not.
In my opinion the default getHashCallback function
which is
Hi,
I have an issue that with the widget
kartik-v/yii2-tabs-x/
for yii2 which uses jquery-stickytabs.Whenever you click a tab with a normal href link (so another page is requested on tab click)
#undefined
is added to the current url before the actual given url of the href is requested.I have already opened an issue there today but i think is a more on an issue of this package.
See: kartik-v/yii2-tabs-x#66
The problem is that there isn't any check if the some hash is actually given.
And because of this
#undefined
is added if no anchor is used in the url.This code:
doesn't check if the hash is
undefined
or not.In my opinion the default
getHashCallback
functionwhich is
should be at least
so
#undefined
isn't attached to tabs with "normal href" links.Then only only
#
but at least this looks better than#undefined
.Or the
changeHash
function should be extended to check if the given hash isn't undefined before attaching it to the url.So a browser back would not return to the previous url with "#undefinded" attached.
I also wonder why the
selectorAttribute
of the link isn't added to the url e.g. via agetHashCallback
function like:regards Benjamin
The text was updated successfully, but these errors were encountered: