@eeacms/volto-n2k 1.0.26 → 1.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,11 +4,12 @@ All notable changes to this project will be documented in this file. Dates are d
4
4
 
5
5
  Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
6
 
7
- ### [1.0.26](https://github.com/eea/volto-n2k/compare/1.0.25...1.0.26) - 29 May 2023
7
+ ### [1.0.27](https://github.com/eea/volto-n2k/compare/1.0.26...1.0.27) - 6 June 2023
8
8
 
9
- #### :bug: Bug Fixes
9
+ #### :hammer_and_wrench: Others
10
10
 
11
- - fix: make carousel work [Miu Razvan - [`d46cb68`](https://github.com/eea/volto-n2k/commit/d46cb68c8416d9dac1c1248b6b5647983e1c9fa1)]
11
+ - fix navigation-anchors [Miu Razvan - [`5b140f7`](https://github.com/eea/volto-n2k/commit/5b140f7eea69aa5f310d62c25147a8c153415d2c)]
12
+ ### [1.0.26](https://github.com/eea/volto-n2k/compare/1.0.25...1.0.26) - 29 May 2023
12
13
 
13
14
  ### [1.0.25](https://github.com/eea/volto-n2k/compare/1.0.24...1.0.25) - 26 April 2023
14
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eeacms/volto-n2k",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "volto-n2k: Volto add-on",
5
5
  "main": "src/index.js",
6
6
  "author": "European Environment Agency: IDM2 A-Team",
@@ -38,7 +38,10 @@ const View = (props) => {
38
38
 
39
39
  const onScroll = () => {
40
40
  const top = document.documentElement.scrollTop;
41
- const offsetHeight = anchorsRef.current?.offsetHeight + 16;
41
+ const offsetHeight =
42
+ screen.page?.width > 767
43
+ ? anchorsRef.current?.offsetHeight + 32
44
+ : document.querySelector('.eea.header .ui.sticky')?.offsetHeight + 32;
42
45
  let newActiveHash,
43
46
  maxTop = 0;
44
47
  hashList.forEach((hash) => {
@@ -53,8 +56,7 @@ const View = (props) => {
53
56
  }
54
57
  setOffsetHeight(offsetHeight);
55
58
  setHeight(
56
- document.querySelector('.eea.header .fixed-container > .ui.sticky')
57
- ?.offsetHeight,
59
+ document.querySelector('.eea.header .ui.sticky')?.offsetHeight + 16,
58
60
  );
59
61
  };
60
62
 
@@ -74,11 +76,16 @@ const View = (props) => {
74
76
  className={cx('sticky-navigation-anchors', {
75
77
  'full-width': sticky,
76
78
  'is-sticky': sticky,
79
+ 'sticky-broken': screen.page?.width <= 767,
77
80
  })}
78
81
  >
79
82
  <div
80
83
  className={cx('navigation-anchors', data.className)}
81
- style={{ ...(height ? { height: `${height}px` } : {}) }}
84
+ style={{
85
+ ...(height && screen.page?.width > 767
86
+ ? { height: `${height}px` }
87
+ : {}),
88
+ }}
82
89
  ref={anchorsRef}
83
90
  >
84
91
  <Container>