Prevent main menu from re-rendering when clicking outside while the menu is closed (#12755)

Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
pull/12766/head
sag​e 2025-01-20 07:33:36 +00:00 zatwierdzone przez GitHub
rodzic 06ce7d2868
commit 841b36ed18
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
3 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -26,6 +26,7 @@ Changelog
* Add support for specifying an operator on `Fuzzy` queries (Tom Usher)
* Remove support for Safari 15 (Thibaud Colas)
* Populate the ImageBlock alt text from the images default alt text when selecting a new image (Matt Westcott)
* Prevent main menu from re-rendering when clicking outside while the menu is closed (Sage Abdullah)
* Fix: Improve handling of translations for bulk page action confirmation messages (Matt Westcott)
* Fix: Ensure custom rich text feature icons are correctly handled when provided as a list of SVG paths (Temidayo Azeez, Joel William, LB (Ben) Johnston)
* Fix: Ensure manual edits to `StreamField` values do not throw an error (Stefan Hammer)

Wyświetl plik

@ -239,7 +239,7 @@ export const Menu: React.FunctionComponent<MenuProps> = ({
const sidebar = document.querySelector('[data-wagtail-sidebar]');
const isInside = sidebar && sidebar.contains(e.target as Node);
if (!isInside) {
if (!isInside && state.navigationPath !== '') {
dispatch({
type: 'set-navigation-path',
path: '',
@ -256,7 +256,7 @@ export const Menu: React.FunctionComponent<MenuProps> = ({
document.removeEventListener('mousedown', onClickOutside);
document.removeEventListener('touchend', onClickOutside);
};
}, []);
}, [state.navigationPath]);
const onClickAccountSettings = () => {
// Pass account expand information to Sidebar component

Wyświetl plik

@ -48,6 +48,7 @@ This feature was developed by Jake Howard.
* Add support for specifying an operator on `Fuzzy` queries (Tom Usher)
* Remove support for Safari 15 (Thibaud Colas)
* Populate the ImageBlock alt text from the images default alt text when selecting a new image (Matt Westcott)
* Prevent main menu from re-rendering when clicking outside while the menu is closed (Sage Abdullah)
### Bug fixes