web-bugs icon indicating copy to clipboard operation
web-bugs copied to clipboard

www.green-red.com - see bug description

Open ashiqurrah7 opened this issue 10 years ago • 11 comments

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

  1. Navigate to: https://www.green-red.com/
  2. …

Expected Behavior: "Get Started" button should take you to another part of the site

Actual Behavior: It does not work

From webcompat.com with ❤️

ashiqurrah7 avatar Oct 07 '16 18:10 ashiqurrah7

I can reproduce this in Firefox 52, the link works in Chrome.

adamopenweb avatar Oct 07 '16 19:10 adamopenweb

I can reproduce the same issue in Android Firefox.

techchic avatar Oct 07 '16 22:10 techchic

The button is:

Screenshot of the site issue

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.

Screenshot of the site issue

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);
        }
      }

karlcow avatar Oct 14 '16 05:10 karlcow

I needs more digging.

karlcow avatar Oct 14 '16 05:10 karlcow

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

karlcow avatar Oct 17 '16 06:10 karlcow

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>

karlcow avatar Oct 17 '16 06:10 karlcow

There is an email on this page. https://www.green-red.com/contact

Let me try.

karlcow avatar Oct 20 '16 02:10 karlcow

Contacted the site.

karlcow avatar Oct 20 '16 02:10 karlcow

Your request (9919) has been received and is being reviewed by our support staff.

karlcow avatar Oct 20 '16 04:10 karlcow

This issue still exists, tested in Firefox 53 for OSX.

adamopenweb avatar Dec 21 '16 23:12 adamopenweb

The "Get Started" button now links to https://www.green-red.com/#scroll-next , which means that this issue is fixed.

reinhart1010 avatar Mar 16 '18 14:03 reinhart1010