File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -269,7 +269,11 @@ const AdvancedRangeControl = props => {
269269 // Since the actual previous value is a preset, force the new custom value
270270 // when changing unit
271271 controlProps . onChangeUnit = ( unit , unitAttrName ) => {
272+ dispatch ( 'core/block-editor' ) . __unstableMarkNextChangeAsNotPersistent ( )
272273 setAttributes ( { [ unitAttrName ] : unit } )
274+ if ( props . onChangeUnit ) {
275+ props . onChangeUnit ( unit )
276+ }
273277 _onChange ( _newValue )
274278 }
275279 }
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ const FontSizeControl = props => {
3939 placeholder = { passedPlaceholder }
4040 onChangeUnit = { value => {
4141 // Change font-size so as not to surprise the user.
42- if ( props . value !== '' && ! isNaN ( Number ( value ) ) ) {
42+ if ( props . value !== '' && ! isNaN ( Number ( props . value ) ) ) {
4343 if ( value === 'em' || value === 'rem' ) {
4444 props . onChange ( String ( pxToEm ( props . value ) ) )
4545 } else if ( value === 'px' ) {
Original file line number Diff line number Diff line change @@ -439,8 +439,12 @@ const FourRangeControl = memo( props => {
439439 // Since the actual previous value is a preset, force the new custom value
440440 // when changing unit
441441 controlProps . onChangeUnit = ( unit , unitAttrName ) => {
442- initialOnChange ( _newValue )
442+ dispatch ( 'core/block-editor' ) . __unstableMarkNextChangeAsNotPersistent ( )
443443 setAttributes ( { [ unitAttrName ] : unit } )
444+ if ( props . onChangeUnit ) {
445+ props . onChangeUnit ( unit )
446+ }
447+ initialOnChange ( _newValue )
444448 }
445449 }
446450
You can’t perform that action at this time.
0 commit comments