Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1beef4f
adapt process to use two letter country code, derive state from it
CGastrell Aug 20, 2025
7a1e3c4
remove debugging code
CGastrell Aug 20, 2025
279ea8e
remove field-phone registration and handlers
CGastrell Aug 22, 2025
4c4f472
deprovision default when not using country selector on phone field
CGastrell Aug 25, 2025
452acd9
cleanup useless code
CGastrell Aug 25, 2025
9001736
use the right field type for international phone number: phone
CGastrell Aug 26, 2025
bb94922
remove field-phone registration and handlers
CGastrell Aug 22, 2025
52f4112
temp, working forwards
CGastrell Aug 28, 2025
6cb0b35
migrating to interactivity, wip
CGastrell Aug 28, 2025
a79ebcf
fully working, needs cleanup and styling
CGastrell Aug 29, 2025
f92e776
clean up code and styles
CGastrell Sep 1, 2025
70a3e29
switch to probe styles specific to background colors
CGastrell Sep 1, 2025
9d90861
fix some failing styles
CGastrell Sep 1, 2025
652a87b
use new initialization and dom listener
CGastrell Sep 1, 2025
8b6cf7a
remove old actions, use more consistent naming
CGastrell Sep 1, 2025
a9756b7
add arrow navigation for dropdown
CGastrell Sep 1, 2025
5f18dab
update test after new markup
CGastrell Sep 1, 2025
e913aa6
show country toggle on toolbar
CGastrell Sep 1, 2025
64585d2
forgotten context consumer declaration
CGastrell Sep 1, 2025
97e1484
poc: use just flag and trunk on block, provide more complete default …
CGastrell Sep 1, 2025
8312ebc
fix searchterm being case sensitive
CGastrell Sep 2, 2025
e005d81
scroll country list to top when searching
CGastrell Sep 2, 2025
4a41631
allow arrow key navigation and selection even when there is no search…
CGastrell Sep 2, 2025
8fae8e2
arrow key navigation selects and scrolls to country
CGastrell Sep 2, 2025
4bde3f4
use pseudo element for down arrow, fix a couple of inconsistent styles
CGastrell Sep 2, 2025
3b1aa42
fix indentation
CGastrell Sep 2, 2025
63998d9
remove unused styling
CGastrell Sep 2, 2025
58e05ff
make phone input look better with animated and outlined styles
CGastrell Sep 2, 2025
2b68af2
minor style/class fixes
CGastrell Sep 5, 2025
50f05c8
changelog
CGastrell Sep 5, 2025
a805db0
split combobox to shared component, add handlers
CGastrell Sep 5, 2025
d4a3ab8
add navigation to combobox on editor
CGastrell Sep 5, 2025
6a71e36
make it a bit more agnostic
CGastrell Sep 5, 2025
a3e8227
allow enter to select the first option if the user has performed a se…
CGastrell Sep 5, 2025
295f963
address PR comments
CGastrell Sep 5, 2025
4a89ab4
inherit background color so input background is honored, but it's tri…
CGastrell Sep 5, 2025
1aaab47
adjust colors to inherit from current
CGastrell Sep 5, 2025
f3bb33a
address more PR comments
CGastrell Sep 5, 2025
011c09f
need to rebuild css class names as they come with 'class=' attached, …
CGastrell Sep 5, 2025
2c4375c
fix test for phone input
CGastrell Sep 5, 2025
4b2fecd
use provided styles for dropdown
CGastrell Sep 8, 2025
5669c36
address bug with calculated probe styles: use browser default 1.2 ins…
CGastrell Sep 8, 2025
185e777
address width and positioning issues
CGastrell Sep 8, 2025
059d91c
fix styles colliding with defaults, use presets for color highlight
CGastrell Sep 8, 2025
34d7b05
use fallback color as it's more reliable than the detected background
CGastrell Sep 8, 2025
667e411
change down arrow, use svg instead of pseudo element
CGastrell Sep 8, 2025
bef77ed
use detected radius style when possible
CGastrell Sep 8, 2025
cc8f982
fix animated and outlined styles on combobox
CGastrell Sep 8, 2025
96ebdaf
use safe background color to avoid falling into transparent
CGastrell Sep 8, 2025
139ad0b
inherit styles from block props
CGastrell Sep 8, 2025
b78e6cd
fix some quirks on editor styles to match frontend
CGastrell Sep 8, 2025
9eeb4d2
fix @since docblock for next version
CGastrell Sep 9, 2025
333b503
add Jetpack changelog
CGastrell Sep 9, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Forms: add searchable country selector dropdown (combobox)
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public static function register_child_blocks() {
'jetpack/field-prefix-options',
'jetpack/field-prefix-default',
'jetpack/field-prefix-onChange',
'jetpack/field-phone-country-toggle',
),
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@
.jetpack-field__input,
.jetpack-field__textarea,
.jetpack-field-dropdown__toggle {
padding-top: 1.4em;
padding-top: max(var(--jetpack--contact-form--input-padding-top, 0), 1.4em);
padding-left: var(--jetpack--contact-form--animated-left-offset);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ window.jetpackForms.generateStyleVariables = function ( formNode ) {
'--jetpack--contact-form--input-height': inputHeight,
'--jetpack--contact-form--font-size': fontSize,
'--jetpack--contact-form--font-family': fontFamily,
'--jetpack--contact-form--line-height': lineHeight,
'--jetpack--contact-form--line-height': lineHeight === 'normal' ? '1.2em' : lineHeight,
'--jetpack--contact-form--button-primary--color': buttonPrimaryColor,
'--jetpack--contact-form--button-primary--background-color': buttonPrimaryBackgroundColor,
'--jetpack--contact-form--button-primary--border': buttonPrimaryBorder,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
import { __ } from '@wordpress/i18n';

/**
* Translated country names for internationalization.
* This provides human-readable, translatable country names
* that can be used alongside the country-list.js data.
*/
export const translatedCountryNames = {
AF: __( 'Afghanistan', 'jetpack-forms' ),
AL: __( 'Albania', 'jetpack-forms' ),
DZ: __( 'Algeria', 'jetpack-forms' ),
AS: __( 'American Samoa', 'jetpack-forms' ),
AD: __( 'Andorra', 'jetpack-forms' ),
AO: __( 'Angola', 'jetpack-forms' ),
AI: __( 'Anguilla', 'jetpack-forms' ),
AG: __( 'Antigua and Barbuda', 'jetpack-forms' ),
AR: __( 'Argentina', 'jetpack-forms' ),
AM: __( 'Armenia', 'jetpack-forms' ),
AW: __( 'Aruba', 'jetpack-forms' ),
AU: __( 'Australia', 'jetpack-forms' ),
AT: __( 'Austria', 'jetpack-forms' ),
AZ: __( 'Azerbaijan', 'jetpack-forms' ),
BS: __( 'Bahamas', 'jetpack-forms' ),
BH: __( 'Bahrain', 'jetpack-forms' ),
BD: __( 'Bangladesh', 'jetpack-forms' ),
BB: __( 'Barbados', 'jetpack-forms' ),
BY: __( 'Belarus', 'jetpack-forms' ),
BE: __( 'Belgium', 'jetpack-forms' ),
BZ: __( 'Belize', 'jetpack-forms' ),
BJ: __( 'Benin', 'jetpack-forms' ),
BM: __( 'Bermuda', 'jetpack-forms' ),
BT: __( 'Bhutan', 'jetpack-forms' ),
BO: __( 'Bolivia', 'jetpack-forms' ),
BA: __( 'Bosnia and Herzegovina', 'jetpack-forms' ),
BW: __( 'Botswana', 'jetpack-forms' ),
BR: __( 'Brazil', 'jetpack-forms' ),
IO: __( 'British Indian Ocean Territory', 'jetpack-forms' ),
VG: __( 'British Virgin Islands', 'jetpack-forms' ),
BN: __( 'Brunei', 'jetpack-forms' ),
BG: __( 'Bulgaria', 'jetpack-forms' ),
BF: __( 'Burkina Faso', 'jetpack-forms' ),
BI: __( 'Burundi', 'jetpack-forms' ),
KH: __( 'Cambodia', 'jetpack-forms' ),
CM: __( 'Cameroon', 'jetpack-forms' ),
CA: __( 'Canada', 'jetpack-forms' ),
CV: __( 'Cape Verde', 'jetpack-forms' ),
KY: __( 'Cayman Islands', 'jetpack-forms' ),
CF: __( 'Central African Republic', 'jetpack-forms' ),
TD: __( 'Chad', 'jetpack-forms' ),
CL: __( 'Chile', 'jetpack-forms' ),
CN: __( 'China', 'jetpack-forms' ),
CX: __( 'Christmas Island', 'jetpack-forms' ),
CC: __( 'Cocos (Keeling) Islands', 'jetpack-forms' ),
CO: __( 'Colombia', 'jetpack-forms' ),
KM: __( 'Comoros', 'jetpack-forms' ),
CG: __( 'Congo - Brazzaville', 'jetpack-forms' ),
CD: __( 'Congo - Kinshasa', 'jetpack-forms' ),
CK: __( 'Cook Islands', 'jetpack-forms' ),
CR: __( 'Costa Rica', 'jetpack-forms' ),
HR: __( 'Croatia', 'jetpack-forms' ),
CU: __( 'Cuba', 'jetpack-forms' ),
CY: __( 'Cyprus', 'jetpack-forms' ),
CZ: __( 'Czech Republic', 'jetpack-forms' ),
CI: __( "Côte d'Ivoire", 'jetpack-forms' ),
DK: __( 'Denmark', 'jetpack-forms' ),
DJ: __( 'Djibouti', 'jetpack-forms' ),
DM: __( 'Dominica', 'jetpack-forms' ),
DO: __( 'Dominican Republic', 'jetpack-forms' ),
EC: __( 'Ecuador', 'jetpack-forms' ),
EG: __( 'Egypt', 'jetpack-forms' ),
SV: __( 'El Salvador', 'jetpack-forms' ),
GQ: __( 'Equatorial Guinea', 'jetpack-forms' ),
ER: __( 'Eritrea', 'jetpack-forms' ),
EE: __( 'Estonia', 'jetpack-forms' ),
SZ: __( 'Eswatini', 'jetpack-forms' ),
ET: __( 'Ethiopia', 'jetpack-forms' ),
FK: __( 'Falkland Islands', 'jetpack-forms' ),
FO: __( 'Faroe Islands', 'jetpack-forms' ),
FJ: __( 'Fiji', 'jetpack-forms' ),
FI: __( 'Finland', 'jetpack-forms' ),
FR: __( 'France', 'jetpack-forms' ),
GF: __( 'French Guiana', 'jetpack-forms' ),
PF: __( 'French Polynesia', 'jetpack-forms' ),
GA: __( 'Gabon', 'jetpack-forms' ),
GM: __( 'Gambia', 'jetpack-forms' ),
GE: __( 'Georgia', 'jetpack-forms' ),
DE: __( 'Germany', 'jetpack-forms' ),
GH: __( 'Ghana', 'jetpack-forms' ),
GI: __( 'Gibraltar', 'jetpack-forms' ),
GR: __( 'Greece', 'jetpack-forms' ),
GL: __( 'Greenland', 'jetpack-forms' ),
GD: __( 'Grenada', 'jetpack-forms' ),
GP: __( 'Guadeloupe', 'jetpack-forms' ),
GU: __( 'Guam', 'jetpack-forms' ),
GT: __( 'Guatemala', 'jetpack-forms' ),
GG: __( 'Guernsey', 'jetpack-forms' ),
GN: __( 'Guinea', 'jetpack-forms' ),
GW: __( 'Guinea-Bissau', 'jetpack-forms' ),
GY: __( 'Guyana', 'jetpack-forms' ),
HT: __( 'Haiti', 'jetpack-forms' ),
HN: __( 'Honduras', 'jetpack-forms' ),
HK: __( 'Hong Kong', 'jetpack-forms' ),
HU: __( 'Hungary', 'jetpack-forms' ),
IS: __( 'Iceland', 'jetpack-forms' ),
IN: __( 'India', 'jetpack-forms' ),
ID: __( 'Indonesia', 'jetpack-forms' ),
IR: __( 'Iran', 'jetpack-forms' ),
IQ: __( 'Iraq', 'jetpack-forms' ),
IE: __( 'Ireland', 'jetpack-forms' ),
IM: __( 'Isle of Man', 'jetpack-forms' ),
IL: __( 'Israel', 'jetpack-forms' ),
IT: __( 'Italy', 'jetpack-forms' ),
JM: __( 'Jamaica', 'jetpack-forms' ),
JP: __( 'Japan', 'jetpack-forms' ),
JE: __( 'Jersey', 'jetpack-forms' ),
JO: __( 'Jordan', 'jetpack-forms' ),
KZ: __( 'Kazakhstan', 'jetpack-forms' ),
KE: __( 'Kenya', 'jetpack-forms' ),
KI: __( 'Kiribati', 'jetpack-forms' ),
XK: __( 'Kosovo', 'jetpack-forms' ),
KW: __( 'Kuwait', 'jetpack-forms' ),
KG: __( 'Kyrgyzstan', 'jetpack-forms' ),
LA: __( 'Laos', 'jetpack-forms' ),
LV: __( 'Latvia', 'jetpack-forms' ),
LB: __( 'Lebanon', 'jetpack-forms' ),
LS: __( 'Lesotho', 'jetpack-forms' ),
LR: __( 'Liberia', 'jetpack-forms' ),
LY: __( 'Libya', 'jetpack-forms' ),
LI: __( 'Liechtenstein', 'jetpack-forms' ),
LT: __( 'Lithuania', 'jetpack-forms' ),
LU: __( 'Luxembourg', 'jetpack-forms' ),
MO: __( 'Macao', 'jetpack-forms' ),
MG: __( 'Madagascar', 'jetpack-forms' ),
MW: __( 'Malawi', 'jetpack-forms' ),
MY: __( 'Malaysia', 'jetpack-forms' ),
MV: __( 'Maldives', 'jetpack-forms' ),
ML: __( 'Mali', 'jetpack-forms' ),
MT: __( 'Malta', 'jetpack-forms' ),
MH: __( 'Marshall Islands', 'jetpack-forms' ),
MQ: __( 'Martinique', 'jetpack-forms' ),
MR: __( 'Mauritania', 'jetpack-forms' ),
MU: __( 'Mauritius', 'jetpack-forms' ),
YT: __( 'Mayotte', 'jetpack-forms' ),
MX: __( 'Mexico', 'jetpack-forms' ),
FM: __( 'Micronesia', 'jetpack-forms' ),
MD: __( 'Moldova', 'jetpack-forms' ),
MC: __( 'Monaco', 'jetpack-forms' ),
MN: __( 'Mongolia', 'jetpack-forms' ),
ME: __( 'Montenegro', 'jetpack-forms' ),
MS: __( 'Montserrat', 'jetpack-forms' ),
MA: __( 'Morocco', 'jetpack-forms' ),
MZ: __( 'Mozambique', 'jetpack-forms' ),
MM: __( 'Myanmar', 'jetpack-forms' ),
NA: __( 'Namibia', 'jetpack-forms' ),
NR: __( 'Nauru', 'jetpack-forms' ),
NP: __( 'Nepal', 'jetpack-forms' ),
NL: __( 'Netherlands', 'jetpack-forms' ),
NC: __( 'New Caledonia', 'jetpack-forms' ),
NZ: __( 'New Zealand', 'jetpack-forms' ),
NI: __( 'Nicaragua', 'jetpack-forms' ),
NE: __( 'Niger', 'jetpack-forms' ),
NG: __( 'Nigeria', 'jetpack-forms' ),
NU: __( 'Niue', 'jetpack-forms' ),
NF: __( 'Norfolk Island', 'jetpack-forms' ),
KP: __( 'North Korea', 'jetpack-forms' ),
MK: __( 'North Macedonia', 'jetpack-forms' ),
MP: __( 'Northern Mariana Islands', 'jetpack-forms' ),
NO: __( 'Norway', 'jetpack-forms' ),
OM: __( 'Oman', 'jetpack-forms' ),
PK: __( 'Pakistan', 'jetpack-forms' ),
PW: __( 'Palau', 'jetpack-forms' ),
PS: __( 'Palestine', 'jetpack-forms' ),
PA: __( 'Panama', 'jetpack-forms' ),
PG: __( 'Papua New Guinea', 'jetpack-forms' ),
PY: __( 'Paraguay', 'jetpack-forms' ),
PE: __( 'Peru', 'jetpack-forms' ),
PH: __( 'Philippines', 'jetpack-forms' ),
PN: __( 'Pitcairn Islands', 'jetpack-forms' ),
PL: __( 'Poland', 'jetpack-forms' ),
PT: __( 'Portugal', 'jetpack-forms' ),
PR: __( 'Puerto Rico', 'jetpack-forms' ),
QA: __( 'Qatar', 'jetpack-forms' ),
RO: __( 'Romania', 'jetpack-forms' ),
RU: __( 'Russia', 'jetpack-forms' ),
RW: __( 'Rwanda', 'jetpack-forms' ),
RE: __( 'Réunion', 'jetpack-forms' ),
BL: __( 'Saint Barthélemy', 'jetpack-forms' ),
SH: __( 'Saint Helena', 'jetpack-forms' ),
KN: __( 'Saint Kitts and Nevis', 'jetpack-forms' ),
LC: __( 'Saint Lucia', 'jetpack-forms' ),
MF: __( 'Saint Martin', 'jetpack-forms' ),
PM: __( 'Saint Pierre and Miquelon', 'jetpack-forms' ),
VC: __( 'Saint Vincent and the Grenadines', 'jetpack-forms' ),
WS: __( 'Samoa', 'jetpack-forms' ),
SM: __( 'San Marino', 'jetpack-forms' ),
SA: __( 'Saudi Arabia', 'jetpack-forms' ),
SN: __( 'Senegal', 'jetpack-forms' ),
RS: __( 'Serbia', 'jetpack-forms' ),
SC: __( 'Seychelles', 'jetpack-forms' ),
SL: __( 'Sierra Leone', 'jetpack-forms' ),
SG: __( 'Singapore', 'jetpack-forms' ),
SK: __( 'Slovakia', 'jetpack-forms' ),
SI: __( 'Slovenia', 'jetpack-forms' ),
SB: __( 'Solomon Islands', 'jetpack-forms' ),
SO: __( 'Somalia', 'jetpack-forms' ),
ZA: __( 'South Africa', 'jetpack-forms' ),
GS: __( 'South Georgia and the South Sandwich Islands', 'jetpack-forms' ),
KR: __( 'South Korea', 'jetpack-forms' ),
ES: __( 'Spain', 'jetpack-forms' ),
LK: __( 'Sri Lanka', 'jetpack-forms' ),
SD: __( 'Sudan', 'jetpack-forms' ),
SR: __( 'Suriname', 'jetpack-forms' ),
SJ: __( 'Svalbard and Jan Mayen', 'jetpack-forms' ),
SE: __( 'Sweden', 'jetpack-forms' ),
CH: __( 'Switzerland', 'jetpack-forms' ),
SY: __( 'Syria', 'jetpack-forms' ),
ST: __( 'São Tomé and Príncipe', 'jetpack-forms' ),
TW: __( 'Taiwan', 'jetpack-forms' ),
TJ: __( 'Tajikistan', 'jetpack-forms' ),
TZ: __( 'Tanzania', 'jetpack-forms' ),
TH: __( 'Thailand', 'jetpack-forms' ),
TL: __( 'Timor-Leste', 'jetpack-forms' ),
TG: __( 'Togo', 'jetpack-forms' ),
TK: __( 'Tokelau', 'jetpack-forms' ),
TO: __( 'Tonga', 'jetpack-forms' ),
TT: __( 'Trinidad and Tobago', 'jetpack-forms' ),
TN: __( 'Tunisia', 'jetpack-forms' ),
TR: __( 'Turkey', 'jetpack-forms' ),
TM: __( 'Turkmenistan', 'jetpack-forms' ),
TC: __( 'Turks and Caicos Islands', 'jetpack-forms' ),
TV: __( 'Tuvalu', 'jetpack-forms' ),
VI: __( 'U.S. Virgin Islands', 'jetpack-forms' ),
UG: __( 'Uganda', 'jetpack-forms' ),
UA: __( 'Ukraine', 'jetpack-forms' ),
AE: __( 'United Arab Emirates', 'jetpack-forms' ),
GB: __( 'United Kingdom', 'jetpack-forms' ),
US: __( 'United States', 'jetpack-forms' ),
UY: __( 'Uruguay', 'jetpack-forms' ),
UZ: __( 'Uzbekistan', 'jetpack-forms' ),
VU: __( 'Vanuatu', 'jetpack-forms' ),
VA: __( 'Vatican City', 'jetpack-forms' ),
VE: __( 'Venezuela', 'jetpack-forms' ),
VN: __( 'Vietnam', 'jetpack-forms' ),
WF: __( 'Wallis and Futuna', 'jetpack-forms' ),
YE: __( 'Yemen', 'jetpack-forms' ),
ZM: __( 'Zambia', 'jetpack-forms' ),
ZW: __( 'Zimbabwe', 'jetpack-forms' ),
};

/**
* Helper function to get translated country name by country code
* @param {string} countryCode - Two-letter country code (e.g., 'US', 'CA')
* @return {string} Translated country name or the original code if not found
*/
export const getTranslatedCountryName = countryCode => {
return translatedCountryNames[ countryCode ] || countryCode;
};
46 changes: 31 additions & 15 deletions projects/packages/forms/src/blocks/field-telephone/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,26 @@ import {
useBlockProps,
useInnerBlocksProps,
BlockContextProvider,
BlockControls,
} from '@wordpress/block-editor';
import { PanelBody, ToggleControl } from '@wordpress/components';
import { PanelBody, ToggleControl, ToolbarButton, ToolbarGroup } from '@wordpress/components';
import { useCallback, useEffect, useMemo, useState } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { globe } from '@wordpress/icons';
import clsx from 'clsx';
import JetpackFieldControls from '../shared/components/jetpack-field-controls';
import useFieldSelected from '../shared/hooks/use-field-selected';
import useFormWrapper from '../shared/hooks/use-form-wrapper';
import useJetpackFieldStyles from '../shared/hooks/use-jetpack-field-styles';
import { countries } from './country-list';
import { getTranslatedCountryName } from './country-names-translated';

const EMPTY_ARRAY = [];

const isBoolean = value => {
return value === true || value === false;
};

export default function PhoneFieldEdit( props ) {
const { setAttributes, attributes, clientId, isSelected } = props;
const {
Expand All @@ -32,29 +39,28 @@ export default function PhoneFieldEdit( props ) {
const { isInnerBlockSelected, hasPlaceholder } = useFieldSelected( clientId );
const { blockStyle } = useJetpackFieldStyles( attributes );
const blockProps = useBlockProps( {
className: clsx(
'jetpack-field',
'jetpack-field-phone',
'jetpack-field-telephone',
width ? ` jetpack-field__width-${ width }` : '',
{
'is-selected': isSelected || isInnerBlockSelected,
'has-placeholder': hasPlaceholder,
}
),
className: clsx( 'jetpack-field', 'jetpack-field-phone', 'jetpack-field-telephone', {
[ `jetpack-field__width-${ width }` ]: width,
'is-selected': isSelected || isInnerBlockSelected,
'has-placeholder': hasPlaceholder,
} ),
style: blockStyle,
} );

useFormWrapper( props );

const countryPairs = useMemo( () => {
return countries.map( country => ( {
label: country.country + ' ' + country.label,
value: country.code,
...country,
country: getTranslatedCountryName( country.code ),
} ) );
}, [] );

const onChangeShowCountrySelector = value => {
if ( ! isBoolean( value ) ) {
// if not a boolean (ie, event object), toggle the value
value = ! showCountrySelector;
}
setAttributes( {
showCountrySelector: value,
} );
Expand Down Expand Up @@ -89,8 +95,7 @@ export default function PhoneFieldEdit( props ) {
// Handler is provided as context from edit as index.js can't pass it as a prop.
const onChangeDefaultCountry = useCallback(
event => {
const value = event.target.value;
setAttributes( { default: value } );
setAttributes( { default: event.target.value } );
},
[ setAttributes ]
);
Expand All @@ -106,6 +111,17 @@ export default function PhoneFieldEdit( props ) {
<div { ...innerBlocksProps } />
</BlockContextProvider>

<BlockControls __experimentalShareWithChildBlocks>
<ToolbarGroup>
<ToolbarButton
title={ __( 'Show country selector', 'jetpack-forms' ) }
icon={ globe }
onClick={ onChangeShowCountrySelector }
className={ showCountrySelector ? 'is-pressed' : undefined }
/>
</ToolbarGroup>
</BlockControls>

<InspectorControls>
<PanelBody title={ __( 'Settings', 'jetpack-forms' ) }>
<ToggleControl
Expand Down
Loading
Loading