Skip to content

Commit f4903ea

Browse files
authored
Merge pull request #46 from opf/bump/primer-upstream
Bump/primer upstream
2 parents fa2a288 + b2f395e commit f4903ea

11 files changed

Lines changed: 72 additions & 36 deletions

File tree

.changeset/hot-dots-look.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openproject/primer-view-components': patch
3+
---
4+
5+
Prevent scrolling when activating ActionMenu form items via space

.changeset/loud-starfishes-hope.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@openproject/primer-view-components': patch
3+
---
4+
5+
Fix bug in ActionMenu/Tooltip/Overlay being always visible in Firefox on ios 17

.github/workflows/add-to-inbox.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Add to Inbox 📥
2+
on:
3+
issues:
4+
types: [opened, reopened]
5+
6+
jobs:
7+
add-to-inbox:
8+
if: ${{ github.repository == 'primer/view_components' }}
9+
runs-on: ubuntu-latest
10+
env:
11+
ISSUE_URL: ${{ github.event.issue.html_url }}
12+
PROJECT_ID: 4503
13+
steps:
14+
- id: get-primer-access-token
15+
uses: actions/create-github-app-token@v1
16+
with:
17+
app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID }}
18+
private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY }}
19+
- name: Add rails label to issue
20+
run: |
21+
gh issue edit $ISSUE_URL --add-label rails
22+
env:
23+
GH_TOKEN: ${{ steps.get-primer-access-token.outputs.token }}
24+
- id: get-github-access-token
25+
uses: actions/create-github-app-token@v1
26+
with:
27+
app-id: ${{ vars.PRIMER_ISSUE_TRIAGE_APP_ID_FOR_GITHUB }}
28+
private-key: ${{ secrets.PRIMER_ISSUE_TRIAGE_APP_PRIVATE_KEY_FOR_GITHUB }}
29+
owner: github
30+
- name: Add issue to project
31+
run: gh project item-add $PROJECT_ID --url $ISSUE_URL --owner github
32+
env:
33+
GH_TOKEN: ${{ steps.get-github-access-token.outputs.token }}

app/components/primer/alpha/action_menu/action_menu_element.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -216,13 +216,16 @@ export class ActionMenuElement extends HTMLElement {
216216
this.#activateItem(event, item)
217217
this.#handleItemActivated(event, item)
218218

219-
// Pressing the space key on a button will cause the page to scroll unless preventDefault()
220-
// is called. Unfortunately, calling preventDefault() will also skip form submission. The
221-
// code below therefore only calls preventDefault() if the button submits a form and the
222-
// button is being activated by the space key.
223-
if (item.getAttribute('type') === 'submit' && this.#isKeyboardActivationViaSpace(event)) {
219+
// Pressing the space key on a button or link will cause the page to scroll unless preventDefault()
220+
// is called. While calling preventDefault() appears to have no effect on link navigation, it skips
221+
// form submission. The code below therefore only calls preventDefault() if the button has been
222+
// activated by the space key, and manually submits the form if the button is a submit button.
223+
if (this.#isKeyboardActivationViaSpace(event)) {
224224
event.preventDefault()
225-
item.closest('form')?.submit()
225+
226+
if (item.getAttribute('type') === 'submit') {
227+
item.closest('form')?.submit()
228+
}
226229
}
227230

228231
return

app/components/primer/alpha/overlay.pcss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ anchored-position[popover] {
33
padding: 0;
44
position: absolute;
55
min-width: 192px;
6-
inset: auto;
76
overflow: visible;
87
background: none;
98
}
@@ -12,17 +11,6 @@ anchored-position[popover] {
1211
display: flex;
1312
}
1413

15-
anchored-position[popover]:not(.\:popover-open) {
16-
display: none;
17-
}
18-
1914
anchored-position.not-anchored::backdrop {
2015
background-color: var(--overlay-backdrop-bgColor, var(--color-neutral-muted));
2116
}
22-
23-
/* This reverts the declaration above for native popover, where `:popover-open` is supported */
24-
@supports selector(:popover-open) {
25-
anchored-position[popover]:not(.\:popover-open) {
26-
display: revert;
27-
}
28-
}

app/components/primer/primer.pcss

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
@import "@oddbird/popover-polyfill/dist/popover.css";
2-
31
/* CSS component styles here */
42

53
/* alpha */

app/components/primer/primer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import '@github/include-fragment-element'
2-
import '@oddbird/popover-polyfill'
32
import './alpha/action_bar_element'
43
import './alpha/dropdown'
54
import './anchored_position'

lib/primer/static/generate_info_arch.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ def call
7070
render_erb_ignoring_markdown_code_fences(docs.base_docstring)
7171
end
7272

73+
accessibility_docs =
74+
if (accessibility_tag_text = docs.tags(:accessibility)&.first&.text)
75+
render_erb_ignoring_markdown_code_fences(accessibility_tag_text)
76+
end
77+
7378
memo[component] = {
7479
"fully_qualified_name" => component.name,
7580
"description" => description,
76-
"accessibility_docs" => docs.tags(:accessibility)&.first&.text,
81+
"accessibility_docs" => accessibility_docs,
7782
"is_form_component" => docs.manifest_entry.form_component?,
7883
"is_published" => docs.manifest_entry.published?,
7984
"requires_js" => docs.manifest_entry.requires_js?,

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"@github/include-fragment-element": "^6.1.1",
5252
"@github/relative-time-element": "^4.0.0",
5353
"@github/tab-container-element": "^3.1.2",
54-
"@oddbird/popover-polyfill": "^0.2.3",
54+
"@oddbird/popover-polyfill": "^0.3.0",
5555
"@primer/behaviors": "^1.3.4"
5656
},
5757
"devDependencies": {

0 commit comments

Comments
 (0)