Prevent reseting height to NaN
[MAILPOET-2835]
This commit is contained in:
@@ -46,15 +46,19 @@ const DividerEdit = ({ attributes, setAttributes }: Props) => {
|
|||||||
max={40}
|
max={40}
|
||||||
allowReset
|
allowReset
|
||||||
onChange={(dividerHeight) => {
|
onChange={(dividerHeight) => {
|
||||||
|
let newHeight = attributeHeight;
|
||||||
|
if (dividerHeight !== undefined) {
|
||||||
|
newHeight = Math.max(dividerHeight, attributeHeight);
|
||||||
|
}
|
||||||
setAttributes({
|
setAttributes({
|
||||||
dividerHeight,
|
dividerHeight,
|
||||||
height: Math.max(dividerHeight, attributes.height),
|
height: newHeight,
|
||||||
});
|
});
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<RangeControl
|
<RangeControl
|
||||||
label={MailPoet.I18n.t('blockDividerDividerWidth')}
|
label={MailPoet.I18n.t('blockDividerDividerWidth')}
|
||||||
value={attributes.dividerWidth}
|
value={attributeDividerWidth}
|
||||||
min={1}
|
min={1}
|
||||||
max={100}
|
max={100}
|
||||||
allowReset
|
allowReset
|
||||||
|
Reference in New Issue
Block a user