Skip to content

Commit 9852d83

Browse files
committed
[#61546] Fix DangerDialog scroll behaviour w/form
Also applies `display: contents` to the `form` element when present. See commit 10e03e7 (PR #234)
1 parent bb22741 commit 9852d83

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/components/primer/open_project/danger_dialog_form_helper.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,21 @@ const SUBMIT_BUTTON_SELECTOR = 'input[type=submit],button[type=submit],button[da
66
class DangerDialogFormHelperElement extends HTMLElement {
77
@target checkbox: HTMLInputElement | undefined
88

9+
get form() {
10+
return this.querySelector('form')
11+
}
12+
913
get submitButton() {
1014
return this.querySelector<HTMLInputElement | HTMLButtonElement>(SUBMIT_BUTTON_SELECTOR)!
1115
}
1216

1317
connectedCallback() {
18+
// makes the custom element behave as if it doesn't exist in the DOM structure, passing all
19+
// styles directly to its children.
1420
this.style.display = 'contents'
21+
if (this.form) {
22+
this.form.style.display = 'contents'
23+
}
1524
this.#reset()
1625
}
1726

0 commit comments

Comments
 (0)