Can’t set all breakpoints to 100
-
There is a use effect that sets all three breakpoints to the defaults, if you set them all to 100:
useEffect( () => { if ( heightLg ===
${ DEFAULT_SPACER_HEIGHT }${ DEFAULT_SPACER_HEIGHT_UNIT }
&& heightMd ===${ DEFAULT_SPACER_HEIGHT }${ DEFAULT_SPACER_HEIGHT_UNIT }
&& heightSm ===${ DEFAULT_SPACER_HEIGHT }${ DEFAULT_SPACER_HEIGHT_UNIT }
) { setAttributes( { heightLg: defaultValue.lg + defaultValue.lg_unit, heightMd: defaultValue.md + defaultValue.md_unit, heightSm: defaultValue.sm + defaultValue.sm_unit, } ); } // eslint-disable-next-line react-hooks/exhaustive-deps }, [] );This means, it’s impossible to set them all to 100, because when you come back to edit, it resets it, and the next time you save, it will save to the defaults from the settings page.
In our case, we have mobile 20, tablet 40 and desktop 60.
If we set all three breakpoints to 100, it will revert to 20, 40 and 60 next time you visit editor, and when you resave, it saves the defaults instead of 100, 100, 100.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Can’t set all breakpoints to 100’ is closed to new replies.