www.green-red.com - see bug description
URL: https://www.green-red.com/ Browser / Version: Firefox 50.0 Operating System: Windows 10 Problem type: Something else - I'll add details below
Steps to Reproduce
- Navigate to: https://www.green-red.com/
- …
Expected Behavior: "Get Started" button should take you to another part of the site
Actual Behavior: It does not work
From webcompat.com with ❤️
I can reproduce this in Firefox 52, the link works in Chrome.
I can reproduce the same issue in Android Firefox.
The button is:

The button markup
<span ng-repeat="coverButton in datamodel.coverButtons" class="ng-scope">
<!-- ngIf: !coverButton.internalLink -->
<!-- ngIf: coverButton.internalLink -->
<a ng-if="coverButton.internalLink"
class="btn btn-lg btn-round btn-danger-default"
ng-click="$root.scrollTo('scroll-next')"
translate="Get Started"
tabindex="0">Get Started</a>
<!-- end ngIf: coverButton.internalLink -->
</span>
It has no href. so the link is probably handled by JS. Let's see.

It dies here:
function createEventHandler(element, events) {
var eventHandler = function (event, type) {
event.isDefaultPrevented = function () {
return event.defaultPrevented;
};
var eventFns = events[type || event.type];
var eventFnsLength = eventFns ? eventFns.length : 0;
if (!eventFnsLength) return;
if (isUndefined(event.immediatePropagationStopped)) {
var originalStopImmediatePropagation = event.stopImmediatePropagation;
event.stopImmediatePropagation = function () {
event.immediatePropagationStopped = true;
if (event.stopPropagation) {
event.stopPropagation();
}
if (originalStopImmediatePropagation) {
originalStopImmediatePropagation.call(event);
}
};
}
event.isImmediatePropagationStopped = function () {
return event.immediatePropagationStopped === true;
};
if ((eventFnsLength > 1)) {
eventFns = shallowCopy(eventFns);
}
for (var i = 0; i < eventFnsLength; i++) {
if (!event.isImmediatePropagationStopped()) {
eventFns[i].call(element, event);
}
}
I needs more digging.
with the help of @miketaylr
ng-click="$root.scrollTo('scroll-next')" passes scroll-next to the function
$rootScope.scrollTo = function (id) {
document.body.scrollTop = document.querySelector('#' + id).getBoundingClientRect().top;
};
So
document.querySelector('#' + 'scroll-next').getBoundingClientRect().top;
# evaluates to 4170.2001953125
# This one is working - GOOD
document.documentElement.scrollTop = document.querySelector('#' + 'scroll-next').getBoundingClientRect().top;
# This one is not working - BAD
document.body.scrollTop = document.querySelector('#' + 'scroll-next').getBoundingClientRect().top;
References:
- https://miketaylr.com/posts/2014/11/document-body-scrolltop.html
- https://developer.mozilla.org/en-US/docs/Web/API/Document/scrollingElement
- https://dev.opera.com/articles/fixing-the-scrolltop-bug/
Switching to needscontatc
For the record a simple anchor would have worked here instead of using JS.
<a href="#scroll-next"
ng-if="coverButton.internalLink"
class="btn btn-lg btn-round btn-danger-default"
translate="Get Started"
tabindex="0">Get Started</a>
There is an email on this page. https://www.green-red.com/contact
Let me try.
Contacted the site.
Your request (9919) has been received and is being reviewed by our support staff.
This issue still exists, tested in Firefox 53 for OSX.
The "Get Started" button now links to https://www.green-red.com/#scroll-next , which means that this issue is fixed.