Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #414 from getblocklab/fix/textarea-default-repeater
Browse files Browse the repository at this point in the history
Fix an issue with the Textarea in the Repeater
  • Loading branch information
lukecarbis authored Sep 4, 2019
2 parents 25d1664 + c3c5a2e commit e9b7576
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/blocks/controls/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ const { TextareaControl } = wp.components;

const BlockLabTextareaControl = ( props ) => {
const { getValue, field, onChange } = props
const initialValue = getValue( props );
const value = 'undefined' !== typeof initialValue ? initialValue : field.default;

return (
<TextareaControl
Expand All @@ -10,8 +12,7 @@ const BlockLabTextareaControl = ( props ) => {
maxLength={ field.maxlength }
rows={ field.number_rows }
help={ field.help }
defaultValue={ field.default }
value={ getValue( props ) }
value={ value }
onChange={ onChange }
/>
);
Expand Down

0 comments on commit e9b7576

Please sign in to comment.