I have set an attribute with a default value:
attributes: {
width: {
type: 'number',
value: 425
},
height: {
type: 'number',
value: 450
},
},
In the edit function I use:
<TextControl
label="Size"
value={ width }
onChange={ ( width ) => setAttributes( { width } ) }
className="width"
/>
Now when I add my block in the editor, the default values are shown, but not saved to the post/page. Unless I edit them to another value and then save my post/page. What am I missing?