File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,9 +451,13 @@ export function createCheckboxRadioReplacement(node) {
451451 const size = Math . max ( Math . min ( w , h ) , 12 )
452452 const s = size
453453
454+ // #311: preserve original vertical-align so the replacement doesn't shift inline layout
455+ let vAlign = 'middle'
456+ try { if ( cs && cs . verticalAlign ) vAlign = cs . verticalAlign } catch { }
457+
454458 const box = document . createElement ( 'div' )
455459 box . setAttribute ( 'data-snapdom-input-replacement' , node . type || 'checkbox' )
456- box . style . cssText = `display:inline-block;width:${ s } px;height:${ s } px;vertical-align:middle ;flex-shrink:0;line-height:0;`
460+ box . style . cssText = `display:inline-block;width:${ s } px;height:${ s } px;vertical-align:${ vAlign } ;flex-shrink:0;line-height:0;`
457461 const svg = document . createElementNS ( 'http://www.w3.org/2000/svg' , 'svg' )
458462 svg . setAttribute ( 'width' , String ( s ) )
459463 svg . setAttribute ( 'height' , String ( s ) )
You can’t perform that action at this time.
0 commit comments