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.
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: https://github.com/kartik-v/yii2-tabs-x/issues/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
function which isshould 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