ScrollTo behavior does not take into account the Fixed elements setting if not on the frontpage, and also on multilingual websites.

Comments

mathilde_dumond created an issue. See original summary.

mathilde_dumond’s picture

StatusFileSize
new1002 bytes
pivica’s picture

Status: Active » Needs review

Thx. Looks good, except comments should break on 80 line mark, but that is a minor thing.

Let's test this on live projects first before merging.

primsi’s picture

Status: Needs review » Needs work
StatusFileSize
new1022 bytes
new1023 bytes

Switching to the new once library and fixing the comment formatting mionor issue from #3.

primsi’s picture

Status: Needs work » Needs review
pivica’s picture

Status: Needs review » Needs work

> Switching to the new once library and fixing the comment formatting mionor issue from #3.

Great but if we are doing this then we should remove jQuery dependency for this JS file and related library, this is the only place we used jQuery $ object.

So let's remove jQuery from `js/anchor-scroll.js` and from library definition.

I also noticed we are missing `core/drupalSettings` dependency for `scroll_to_top` library, can we add it with the rest of this changes?

pivica’s picture

Status: Needs work » Needs review
StatusFileSize
new1.66 KB
new1.25 KB

Here is a new patch that is removing jQuery fully from anchor-scroll.js and related lib.

> I also noticed we are missing `core/drupalSettings` dependency for `scroll_to_top` library

I mixed things here, this is not correct.

pivica’s picture

@Primsi I am wondering why you decided to change to new once in the first place. Asking this, because if there is some additional reason then just removing depreciated dependency we should then also do this for scroll-to-top.js file. Quickly checked this file and we are using once and some usual jQuery methods so we can easily remove jQuery from this file too if/when needed in a follow up issue.

mathilde_dumond’s picture

tested that locally and the last patch fixed the problem

  • pivica committed b3576970 on 8.x-1.x
    Issue #3325962 by pivica, Primsi, mathilde_dumond: ScrollTo behavior...
pivica’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.