Skip to content

Commit 8aea8e0

Browse files
committed
Disable placeholder input for number
1 parent f61d8ea commit 8aea8e0

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

projects/packages/forms/src/blocks/contact-form/child-blocks.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,6 @@ export const childBlocks = [
404404
type: 'string',
405405
default: __( 'Number', 'jetpack-forms' ),
406406
},
407-
defaultValue: {
408-
type: 'number',
409-
default: '',
410-
},
411407
},
412408
},
413409
},

projects/packages/forms/src/blocks/contact-form/components/jetpack-field.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ const JetpackField = props => {
5252
onChange={ e => setAttributes( { placeholder: e.target.value } ) }
5353
style={ fieldStyle }
5454
type={ type }
55-
value=""
56-
placeholder={ placeholder }
55+
value={ placeholder }
5756
onClick={ event => type === 'file' && event.preventDefault() }
5857
onKeyDown={ event => {
5958
if ( event.defaultPrevented || event.key !== 'Enter' ) {
@@ -71,6 +70,7 @@ const JetpackField = props => {
7170
setAttributes={ setAttributes }
7271
placeholder={ placeholder }
7372
attributes={ attributes }
73+
hidePlaceholder={ type === 'number' }
7474
/>
7575
</>
7676
);

0 commit comments

Comments
 (0)