Skip to content

Commit 9d1060b

Browse files
CGastrellclaudeCopilot
authored
Fix Forms combobox dropdown styling overrides for phone input field (#46408)
* remove backdrop filter for phone input element on editor, it's handled by its wrapper * use same z-index strategy for combobox dropdown on editor as in frontend * use better fitting strategy for combobox dropdown * Add changelog for forms combobox styling fixes 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * use right variable for setting border size * Add default value for CSS var Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * reorder internal z layers for combobox * fix outlined styled label not getting border when combobox is open * fix prefix button background and states * move z-index rule to phone block container * re-set steps wrapper and progress z-index to play nice with combobox overlay * make Douglas happy --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent cdbb4ac commit 9d1060b

File tree

6 files changed

+45
-12
lines changed

6 files changed

+45
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Significance: patch
2+
Type: fixed
3+
4+
Fix combobox dropdown styling overrides for phone input field

projects/packages/forms/src/blocks/form-progress-indicator/style.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
position: relative;
1111
overflow: visible;
1212
box-sizing: border-box;
13+
z-index: 1;
1314

1415
.jetpack-form-progress-indicator-steps {
1516
display: flex;

projects/packages/forms/src/blocks/input-phone/editor.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
.jetpack-contact-form .jetpack-field.jetpack-field-phone,
22
.jetpack-contact-form .jetpack-field.jetpack-field-telephone {
33

4+
&:has(.jetpack-combobox-open) {
5+
// GB re-sets z-index every time the block is moved
6+
// so we need to force it to 3 to stay on top of other
7+
// blocks so the dropdown overlay stays on top of them.
8+
z-index: 3 !important;
9+
}
10+
411
.jetpack-field__input,
512
.jetpack-field__textarea {
613
box-sizing: border-box;
@@ -97,6 +104,10 @@
97104
}
98105
}
99106
}
107+
108+
.jetpack-field__input-element {
109+
backdrop-filter: none;
110+
}
100111
}
101112
}
102113

projects/packages/forms/src/contact-form/css/combobox.scss

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
}
1111

1212
// special override for aggressive themes (2021) that set background-color
13-
.has-background & button.jetpack-combobox-trigger:not(:active):not(:hover):not(.has-background) {
13+
button.jetpack-combobox-trigger:not(:active):not(:hover),
14+
button.jetpack-combobox-trigger:not(:active):hover,
15+
button.jetpack-combobox-trigger:focus {
1416
background-color: transparent;
17+
color: inherit;
1518
}
1619

1720
.jetpack-combobox-trigger {
@@ -65,7 +68,8 @@
6568

6669
.jetpack-combobox-dropdown {
6770
position: absolute;
68-
left: -1px;
71+
left: calc(var(--jetpack--contact-form--border-left-size, 1px) * -1);
72+
right: calc(var(--jetpack--contact-form--border-left-size, 1px) * -1);
6973
top: 100%;
7074
width: -webkit-fill-available;
7175
min-width: 60%;
@@ -88,7 +92,14 @@
8892
.jetpack-combobox-search {
8993
width: 100%;
9094
padding: 8px 12px;
91-
border: none;
95+
96+
// Using !important to keep tight control over the
97+
// search input looks.
98+
border-top: none !important;
99+
border-left: none !important;
100+
border-right: none !important;
101+
border-bottom-left-radius: 0 !important;
102+
border-bottom-right-radius: 0 !important;
92103
border-bottom: 1px solid #eee;
93104
outline: none;
94105
font-size: 14px;
@@ -97,8 +108,6 @@
97108
color: inherit;
98109
background-color: inherit;
99110
z-index: 1;
100-
border-bottom-left-radius: 0;
101-
border-bottom-right-radius: 0;
102111

103112
&:focus {
104113
outline: none;

projects/packages/forms/src/contact-form/css/grunion.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
opacity: 0.3;
3535
}
3636

37+
.jetpack-form-steps-wrapper {
38+
z-index: 2;
39+
}
40+
3741
.jetpack-form-step {
3842
display: none;
3943
}

projects/packages/forms/src/contact-form/css/phone-field.scss

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
}
3131

3232
.jetpack-field__input-prefix:not([hidden]) {
33-
background-color: inherit;
33+
background-color: transparent;
34+
z-index: 1;
3435

3536
.jetpack-field__input-element {
3637
width: 100%;
@@ -44,7 +45,6 @@
4445
}
4546
}
4647

47-
4848
.jetpack-field__input-element {
4949
border: 0;
5050
font: inherit;
@@ -59,6 +59,7 @@
5959
min-width: unset;
6060
min-height: unset;
6161
backdrop-filter: none;
62+
z-index: 1;
6263

6364
&:not(.jetpack-field__input-prefix .jetpack-field__input-element) {
6465
letter-spacing: inherit;
@@ -156,12 +157,15 @@
156157
font-size: 0.8em;
157158
}
158159
}
159-
}
160160

161-
.notched-label:has(~* .jetpack-field__input-element:focus) .notched-label__notch,
162-
.notched-label:has(~* .jetpack-field__input-element.has-value) .notched-label__notch,
163-
.notched-label:has(~* .jetpack-field__input-element.has-placeholder) .notched-label__notch {
164-
border-top-color: transparent !important;
161+
&:has(~.jetpack-field__input-phone-wrapper.is-combobox-open) .notched-label__notch,
162+
&:has(~.jetpack-field__input-phone-wrapper:focus-within) .notched-label__notch,
163+
&:has(~* .jetpack-field__input-element:focus) .notched-label__notch,
164+
&:has(~* .jetpack-field__input-element.has-value) .notched-label__notch,
165+
&:has(~* .jetpack-field__input-element.has-placeholder) .notched-label__notch {
166+
border-top-color: transparent !important;
167+
}
165168
}
169+
166170
}
167171
}

0 commit comments

Comments
 (0)