@primer/view-components 0.15.0-rc.ef1c6ef7 → 0.15.0-rc.f152dba4
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.
@@ -43,7 +43,7 @@ const DIRECTION_CLASSES = [
|
|
43
43
|
'tooltip-ne',
|
44
44
|
'tooltip-se',
|
45
45
|
'tooltip-nw',
|
46
|
-
'tooltip-sw'
|
46
|
+
'tooltip-sw',
|
47
47
|
];
|
48
48
|
function closeOpenTooltips(except) {
|
49
49
|
for (const tooltip of openTooltips) {
|
@@ -270,11 +270,11 @@ class ToolTipElement extends HTMLElement {
|
|
270
270
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
271
271
|
// @ts-ignore popoverTargetElement is not in the type definition
|
272
272
|
(_b = this.control.popoverTargetElement) === null || _b === void 0 ? void 0 : _b.addEventListener('beforetoggle', this, {
|
273
|
-
signal
|
273
|
+
signal,
|
274
274
|
});
|
275
275
|
this.ownerDocument.addEventListener('focusout', focusOutListener);
|
276
276
|
this.ownerDocument.addEventListener('focusin', focusInListener);
|
277
|
-
this.ownerDocument.addEventListener('keydown', this, { signal });
|
277
|
+
this.ownerDocument.addEventListener('keydown', this, { signal, captures: true });
|
278
278
|
}
|
279
279
|
disconnectedCallback() {
|
280
280
|
var _a;
|
@@ -296,6 +296,10 @@ class ToolTipElement extends HTMLElement {
|
|
296
296
|
const isMouseDownOnButton = event.type === 'mousedown' && event.currentTarget === this.control;
|
297
297
|
const isOpeningOtherPopover = event.type === 'beforetoggle' && event.currentTarget !== this;
|
298
298
|
const shouldHide = isMouseLeaveFromButton || isEscapeKeydown || isMouseDownOnButton || isOpeningOtherPopover;
|
299
|
+
if (showing && isEscapeKeydown) {
|
300
|
+
event.stopImmediatePropagation();
|
301
|
+
event.preventDefault();
|
302
|
+
}
|
299
303
|
await Promise.resolve();
|
300
304
|
if (!showing && shouldShow && !isPopoverOpen(this)) {
|
301
305
|
__classPrivateFieldSet(this, _ToolTipElement_showReason, event.type === 'mouseenter' ? 'mouse' : 'focus', "f");
|
@@ -409,7 +413,7 @@ _ToolTipElement_abortController = new WeakMap(), _ToolTipElement_align = new Wea
|
|
409
413
|
const position = getAnchoredPosition(this, this.control, {
|
410
414
|
side: __classPrivateFieldGet(this, _ToolTipElement_side, "f"),
|
411
415
|
align: __classPrivateFieldGet(this, _ToolTipElement_align, "f"),
|
412
|
-
anchorOffset: TOOLTIP_OFFSET
|
416
|
+
anchorOffset: TOOLTIP_OFFSET,
|
413
417
|
});
|
414
418
|
const anchorSide = position.anchorSide;
|
415
419
|
const align = position.anchorAlign;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@primer/view-components",
|
3
|
-
"version": "0.15.0-rc.
|
3
|
+
"version": "0.15.0-rc.f152dba4",
|
4
4
|
"description": "ViewComponents for the Primer Design System",
|
5
5
|
"main": "app/assets/javascripts/primer_view_components.js",
|
6
6
|
"module": "app/components/primer/primer.js",
|