Skip to content

Commit

Permalink
Merge pull request #1192 from City-of-Helsinki/HDS-2039-Investigate-w…
Browse files Browse the repository at this point in the history
…hy-icons-in-the-language-button-interact-different-ways

HDS-2039 - Fix language menu icon click issue
  • Loading branch information
Riippi authored Jan 4, 2024
2 parents c13d2ac + 0834130 commit 04d8aaa
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
#### Fixed

- [Dropdown] Clearing values from disabled Dropdowns is prohibited
- [Header.ActionBarItem] Fix click event handling issue in icons

### Core

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exports[`<Footer /> spec renders the component 1`] = `
<span
class="copyrightHolder"
>
© Copyright 2023
© Copyright 2024
</span>
<span
class="copyrightDot"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ button.actionBarItem {
margin: 0 auto;
padding: 3px 0 0;
width: var(--icon-size);
pointer-events: none;

& > svg {
display: block;
Expand All @@ -37,6 +38,7 @@ button.actionBarItem {
font-size: var(--action-bar-item-title-font-size);
margin: 0 auto;
white-space: nowrap;
pointer-events: none;

& > svg {
display: block;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ export const HeaderActionBarItemWithDropdown = (properties: HeaderActionBarItemW
};

const handleDocumentClick = (event) => {
if (!visible) return;
const container = getContainer();
const eventTargetNode = event.target;
if (!container.contains(eventTargetNode)) {
Expand All @@ -95,18 +96,18 @@ export const HeaderActionBarItemWithDropdown = (properties: HeaderActionBarItemW
};

const handleBlur = (event) => {
if (!visible) return;
const container = getContainer();
const eventTargetNode = event.relatedTarget;
if (!container.contains(eventTargetNode)) {
setDisplayProperty(false);
}
};

// Set event listener only when dropdown open
useEffect(() => {
if (visible) document.addEventListener('click', handleDocumentClick);
document.addEventListener('click', handleDocumentClick);
return () => document.removeEventListener('click', handleDocumentClick);
}, [containerElementRef.current, visible]);
}, [containerElementRef.current]);

// Hide the component if there is no content
useEffect(() => {
Expand Down

0 comments on commit 04d8aaa

Please sign in to comment.