@refinitiv-ui/elements 7.10.8 → 7.10.9
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 +6 -0
- package/lib/overlay/managers/interaction-lock-manager.js +8 -4
- package/lib/overlay/managers/viewport-manager.js +1 -1
- package/lib/tooltip/elements/tooltip-element.js +1 -1
- package/lib/tooltip/managers/tooltip-manager.js +2 -2
- package/lib/version.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [7.10.9](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.10.8...@refinitiv-ui/elements@7.10.9) (2024-04-01)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **tooltip:** handle body removal ([#1126](https://github.com/Refinitiv/refinitiv-ui/issues/1126)) ([1f00360](https://github.com/Refinitiv/refinitiv-ui/commit/1f00360f79c154d41295c0807536cdd0aa13efeb))
|
|
11
|
+
|
|
6
12
|
## [7.10.8](https://github.com/Refinitiv/refinitiv-ui/compare/@refinitiv-ui/elements@7.10.7...@refinitiv-ui/elements@7.10.8) (2024-03-18)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -196,8 +196,8 @@ export class ScrollLockManager {
|
|
|
196
196
|
}
|
|
197
197
|
else {
|
|
198
198
|
// Since we don't know if is the body or html, get max.
|
|
199
|
-
this.scrollTop = Math.max(document.documentElement.scrollTop, document.body
|
|
200
|
-
this.scrollLeft = Math.max(document.documentElement.scrollLeft, document.body
|
|
199
|
+
this.scrollTop = Math.max(document.documentElement.scrollTop, document.body?.scrollTop ?? 0);
|
|
200
|
+
this.scrollLeft = Math.max(document.documentElement.scrollLeft, document.body?.scrollLeft ?? 0);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
@@ -211,8 +211,12 @@ export class ScrollLockManager {
|
|
|
211
211
|
}
|
|
212
212
|
else {
|
|
213
213
|
// Since we don't know if is the body or html, set both.
|
|
214
|
-
document.documentElement.scrollTop =
|
|
215
|
-
document.documentElement.scrollLeft =
|
|
214
|
+
document.documentElement.scrollTop = this.scrollTop;
|
|
215
|
+
document.documentElement.scrollLeft = this.scrollTop;
|
|
216
|
+
if (document.body) {
|
|
217
|
+
document.body.scrollTop = this.scrollTop;
|
|
218
|
+
document.body.scrollLeft = this.scrollLeft;
|
|
219
|
+
}
|
|
216
220
|
}
|
|
217
221
|
}
|
|
218
222
|
/**
|
|
@@ -97,7 +97,7 @@ export class ViewportManager {
|
|
|
97
97
|
// @ts-ignore
|
|
98
98
|
// TODO: Remove @ts-ignore and re-test again when standardized zoom is implemented across major browsers and TypeScript, https://github.com/w3c/csswg-drafts/issues/5623
|
|
99
99
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
100
|
-
const zoom = parseFloat(window.getComputedStyle(document.body).zoom);
|
|
100
|
+
const zoom = document.body ? parseFloat(window.getComputedStyle(document.body).zoom) : 1;
|
|
101
101
|
const screenHeight = screenRect.height / zoom;
|
|
102
102
|
const screenWidth = screenRect.width / zoom;
|
|
103
103
|
const { top, left, bottom, right } = viewport.getBoundingClientRect();
|
|
@@ -42,7 +42,7 @@ tooltipElement.setAttribute('ref', 'title-override');
|
|
|
42
42
|
tooltipElement.condition = condition;
|
|
43
43
|
tooltipElement.renderer = renderer;
|
|
44
44
|
const appendTitleTooltip = () => {
|
|
45
|
-
document.body
|
|
45
|
+
document.body?.appendChild(tooltipElement);
|
|
46
46
|
};
|
|
47
47
|
if (document.body) {
|
|
48
48
|
appendTitleTooltip();
|
|
@@ -96,7 +96,7 @@ class TooltipManager {
|
|
|
96
96
|
document.addEventListener('mouseleave', this.onMouseLeave, eventOptions);
|
|
97
97
|
document.addEventListener('wheel', this.onWheel, eventOptions);
|
|
98
98
|
document.addEventListener('keydown', this.onKeyDown, eventOptions);
|
|
99
|
-
document.body
|
|
99
|
+
document.body?.addEventListener('blur', this.onBlur, eventOptions);
|
|
100
100
|
const clickEventOptions = { passive: true, capture: true };
|
|
101
101
|
document.addEventListener('click', this.onClick, clickEventOptions);
|
|
102
102
|
document.addEventListener('contextmenu', this.onClick, clickEventOptions);
|
|
@@ -111,7 +111,7 @@ class TooltipManager {
|
|
|
111
111
|
document.removeEventListener('mouseleave', this.onMouseLeave);
|
|
112
112
|
document.removeEventListener('wheel', this.onWheel);
|
|
113
113
|
document.removeEventListener('keydown', this.onKeyDown);
|
|
114
|
-
document.body
|
|
114
|
+
document.body?.removeEventListener('blur', this.onBlur);
|
|
115
115
|
document.removeEventListener('click', this.onClick, true);
|
|
116
116
|
document.removeEventListener('contextmenu', this.onClick, true);
|
|
117
117
|
}
|
package/lib/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '7.10.
|
|
1
|
+
export const VERSION = '7.10.9';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@refinitiv-ui/elements",
|
|
3
|
-
"version": "7.10.
|
|
3
|
+
"version": "7.10.9",
|
|
4
4
|
"description": "Element Framework Elements",
|
|
5
5
|
"author": "LSEG",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
},
|
|
355
355
|
"devDependencies": {
|
|
356
356
|
"@refinitiv-ui/core": "^7.4.1",
|
|
357
|
-
"@refinitiv-ui/demo-block": "^7.1.
|
|
357
|
+
"@refinitiv-ui/demo-block": "^7.1.8",
|
|
358
358
|
"@refinitiv-ui/i18n": "^7.1.3",
|
|
359
359
|
"@refinitiv-ui/phrasebook": "^7.1.1",
|
|
360
360
|
"@refinitiv-ui/test-helpers": "^7.1.0",
|
|
@@ -373,5 +373,5 @@
|
|
|
373
373
|
"publishConfig": {
|
|
374
374
|
"access": "public"
|
|
375
375
|
},
|
|
376
|
-
"gitHead": "
|
|
376
|
+
"gitHead": "e69ebb5e49499843241d90cd4b6812193c7cbfb7"
|
|
377
377
|
}
|