@primer/view-components 0.2.0-rc.d483f943 → 0.2.0-rc.e70004c0

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.
@@ -116,19 +116,6 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
116
116
  __classPrivateFieldGet(this, _ActionMenuElement_instances, "a", _ActionMenuElement_firstItem_get).focus();
117
117
  }
118
118
  else if (__classPrivateFieldGet(this, _ActionMenuElement_instances, "m", _ActionMenuElement_isActivationKeydown).call(this, event) || (event instanceof MouseEvent && event.type === 'click')) {
119
- // Hide popover after current event loop to prevent changes in focus from
120
- // altering the target of the event. Not doing this specifically affects
121
- // <a> tags. It causes the event to be sent to the currently focused element
122
- // instead of the anchor, which effectively prevents navigation, i.e. it
123
- // appears as if hitting enter does nothing. Curiously, clicking instead
124
- // works fine.
125
- if (this.selectVariant !== 'multiple') {
126
- setTimeout(() => { var _a; return (_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.hidePopover(); });
127
- }
128
- // The rest of the code below deals with single/multiple selection behavior, and should not
129
- // interfere with events fired by menu items whose behavior is specified outside the library.
130
- if (this.selectVariant !== 'multiple' && this.selectVariant !== 'single')
131
- return;
132
119
  const item = event.target.closest(menuItemSelectors.join(','));
133
120
  if (!item)
134
121
  return;
@@ -148,6 +135,15 @@ let ActionMenuElement = class ActionMenuElement extends HTMLElement {
148
135
  // prevent buttons from being clicked twice
149
136
  event.preventDefault();
150
137
  }
138
+ // Hide popover after current event loop to prevent changes in focus from
139
+ // altering the target of the event. Not doing this specifically affects
140
+ // <a> tags. It causes the event to be sent to the currently focused element
141
+ // instead of the anchor, which effectively prevents navigation, i.e. it
142
+ // appears as if hitting enter does nothing. Curiously, clicking instead
143
+ // works fine.
144
+ if (this.selectVariant !== 'multiple') {
145
+ setTimeout(() => { var _a; return (_a = this.popoverElement) === null || _a === void 0 ? void 0 : _a.hidePopover(); });
146
+ }
151
147
  }
152
148
  }
153
149
  };
@@ -1 +1 @@
1
- .ButtonGroup{display:inline-flex}.ButtonGroup .Button{border-radius:0;margin-inline-end:-1px;position:relative}.ButtonGroup .Button:active,.ButtonGroup .Button:focus,.ButtonGroup .Button:hover{z-index:1}.ButtonGroup>.Button-withTooltip:first-child .Button,.ButtonGroup>:first-child{border-bottom-left-radius:var(--borderRadius-medium,6px);border-top-left-radius:var(--borderRadius-medium,6px)}.ButtonGroup>.Button-withTooltip:last-child .Button,.ButtonGroup>:last-child{border-bottom-right-radius:var(--borderRadius-medium,6px);border-top-right-radius:var(--borderRadius-medium,6px)}
1
+ .ButtonGroup{display:inline-flex}.ButtonGroup button{border-radius:0;margin-inline-end:-1px;position:relative}.ButtonGroup button:active,.ButtonGroup button:focus,.ButtonGroup button:hover{z-index:1}.ButtonGroup>.Button-withTooltip:first-child button,.ButtonGroup>:first-child{border-bottom-left-radius:var(--borderRadius-medium,6px);border-top-left-radius:var(--borderRadius-medium,6px)}.ButtonGroup>.Button-withTooltip:last-child button,.ButtonGroup>:last-child{border-bottom-right-radius:var(--borderRadius-medium,6px);border-top-right-radius:var(--borderRadius-medium,6px)}
@@ -2,13 +2,13 @@
2
2
  "name": "beta/button_group",
3
3
  "selectors": [
4
4
  ".ButtonGroup",
5
- ".ButtonGroup .Button",
6
- ".ButtonGroup .Button:active",
7
- ".ButtonGroup .Button:focus",
8
- ".ButtonGroup .Button:hover",
9
- ".ButtonGroup>.Button-withTooltip:first-child .Button",
5
+ ".ButtonGroup button",
6
+ ".ButtonGroup button:active",
7
+ ".ButtonGroup button:focus",
8
+ ".ButtonGroup button:hover",
9
+ ".ButtonGroup>.Button-withTooltip:first-child button",
10
10
  ".ButtonGroup>:first-child",
11
- ".ButtonGroup>.Button-withTooltip:last-child .Button",
11
+ ".ButtonGroup>.Button-withTooltip:last-child button",
12
12
  ".ButtonGroup>:last-child"
13
13
  ]
14
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/view-components",
3
- "version": "0.2.0-rc.d483f943",
3
+ "version": "0.2.0-rc.e70004c0",
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",