Skip to content

Commit

Permalink
Fix react warning error on font upload page (#502)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-hamano authored Jan 4, 2024
1 parent fcc9a1c commit f6e37e1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/local-fonts/upload-font-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ function UploadFontForm( {
name="font-name"
id="font-name"
placeholder={ __( 'Font name', 'create-block-theme' ) }
value={ formData.name }
value={ formData.name || '' }
onChange={ ( val ) =>
setFormData( { ...formData, name: val } )
}
Expand All @@ -164,7 +164,7 @@ function UploadFontForm( {
label={ __( 'Font style:', 'create-block-theme' ) }
name="font-style"
id="font-style"
value={ formData.style }
value={ formData.style || 'normal' }
onChange={ ( val ) =>
setFormData( { ...formData, style: val } )
}
Expand Down Expand Up @@ -207,7 +207,11 @@ function UploadFontForm( {
<input
type="hidden"
name="font-credits"
value={ JSON.stringify( formData.fontCredits ) }
value={
formData.fontCredits
? JSON.stringify( formData.fontCredits )
: ''
}
/>
</form>

Expand Down

0 comments on commit f6e37e1

Please sign in to comment.