Skip to content

Commit

Permalink
Merge branch 'v2' into contactlink_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mamico authored Dec 14, 2024
2 parents 53fde7d + aaa7549 commit 43670c4
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
### [7.33.2](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v7.33.1...v7.33.2) (2024-12-09)


### Bug Fixes

* component HandleAnchor when loading deferred items ([75b27ad](https://github.com/RedTurtle/design-comuni-plone-theme/commit/75b27ad5298e4733cab9784a1e7ad1c2f622fdee))

### [7.33.1](https://github.com/RedTurtle/design-comuni-plone-theme/compare/v7.33.0...v7.33.1) (2024-11-26)


Expand Down
6 changes: 6 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
- ...
-->

## Versione 7.33.2 (09/12/2024)

### Fix

- Sistemato lo scroll delle pagine con url con ancora, nel caso in cui la pagina abbia degli oggetti caricati separatamente. (es la vista di una UO).

## Versione 7.33.1 (26/11/2024)

### Fix
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "design-comuni-plone-theme",
"description": "Volto Theme for Italia design guidelines",
"license": "MIT",
"version": "7.33.1",
"version": "7.33.2",
"addons": [
"@plone-collective/volto-sentry",
"volto-multilingual-widget",
Expand Down
4 changes: 2 additions & 2 deletions publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,9 @@ maintenance:
name: io-Comune - Il sito AgID per Comuni ed Enti Pubblici
platforms:
- web
releaseDate: '2024-11-26'
releaseDate: '2024-12-09'
softwareType: standalone/web
softwareVersion: 7.33.1
softwareVersion: 7.33.2
url: 'https://github.com/italia/design-comuni-plone-theme'
usedBy:
- ASP Comuni Modenesi Area Nord
Expand Down
12 changes: 9 additions & 3 deletions src/components/ItaliaTheme/AppExtras/HandleAnchor.jsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
import React, { useEffect } from 'react';
import { useLocation } from 'react-router-dom';

import { useSelector } from 'react-redux';
const HandleAnchor = () => {
const location = useLocation();
const content = useSelector((state) => state.content);

useEffect(() => {
if (location.hash) {
const sr = Object.keys(content.subrequests ?? {});
const loaded =
content.get?.loaded &&
sr.filter((k) => content.subrequests[k].loaded).length === sr.length;
if (location.hash && content && loaded) {
// eslint-disable-next-line no-unused-expressions
document.getElementById(location.hash.replace('#', ''))?.scrollIntoView({
behavior: 'smooth',
block: 'start',
inline: 'center',
});
}
}, [location]);
}, [location, content]);
return <></>;
};

Expand Down

0 comments on commit 43670c4

Please sign in to comment.