DropDownToggle links should not cause the browser to navigate
Basics
Technical
Logistics
Basics
Technical
Logistics
Description
The way in which the DropDownToggle a tags are currently constructed causes the browser to navigate to the underlying href attribute (being #). In many situations, this won't be obvious, aside from the browser scrolling to the top of the page. In the case of a HTML page with a <base> element configured , however, this link is now considered to be relative to the base tag. In this situation, when a user clicks the link, their browser navigates away from the current page because the link's href is no longer on the same page. As a result, the user can't use the EDS correctly.
In order to resolve this issue, the onclick event handlers for the DropDownToggle links must return false; at the end of the functions, which will prevent the browser navigating (eg carrying out the default browser behaviour on the link).
Thanks for merging this in. Is there a schedule for a new release of this code? It would be great to have a package that incorporates several of these recent fixes.
Rod Widdowson
April 29, 2015 at 2:14 PM
tested on Chrome/FF/IE/Opera.
Unsurprisingly it works fine
Rod Widdowson
April 29, 2015 at 8:47 AM
Thanks. I;ve encorporated this patch as r138 and it will be part of 1.1 to be released soon.
The way in which the DropDownToggle a tags are currently constructed causes the browser to navigate to the underlying href attribute (being
#
). In many situations, this won't be obvious, aside from the browser scrolling to the top of the page. In the case of a HTML page with a<base>
element configured , however, this link is now considered to be relative to the base tag. In this situation, when a user clicks the link, their browser navigates away from the current page because the link's href is no longer on the same page. As a result, the user can't use the EDS correctly.In order to resolve this issue, the onclick event handlers for the DropDownToggle links must
return false;
at the end of the functions, which will prevent the browser navigating (eg carrying out the default browser behaviour on the link).My fix is at
https://github.com/jcu-eresearch/js-embedded-discovery/commit/7d2667ff0613e79437d5813184be24f7f83a4b06 for the visual diff, and a patch is available.