@@ -31,9 +31,11 @@ function readUiCss(): string {
3131function controlsHtml ( ) {
3232 return `
3333 <main>
34- <label class="field"><input value="field input" /></label>
34+ <label class="field"><input type="text" value="field input" /></label>
3535 <label class="field"><textarea>field textarea</textarea></label>
3636 <label class="field"><select><option>field select</option></select></label>
37+ <label class="field checkbox"><input type="checkbox" /><span>field checkbox</span></label>
38+ <label class="field checkbox"><input type="radio" /><span>field radio</span></label>
3739 <input class="config-search__input" value="search" />
3840 <input class="settings-theme-import__input" value="theme" />
3941 <label class="config-raw-field"><textarea>raw config</textarea></label>
@@ -155,4 +157,33 @@ describeBrowserLayout("touch-primary form controls", () => {
155157 await closeMobileFixture ( fixture ) ;
156158 }
157159 } ) ;
160+
161+ it ( "aligns text controls without stretching checkbox and radio inputs" , async ( ) => {
162+ const fixture = await openMobileFixture ( ) ;
163+ const { page } = fixture ;
164+ try {
165+ const dimensions = await page . evaluate ( ( ) => {
166+ const height = ( selector : string ) => {
167+ const node = document . querySelector ( selector ) ;
168+ if ( ! ( node instanceof HTMLElement ) ) {
169+ throw new Error ( `Missing control ${ selector } ` ) ;
170+ }
171+ return node . getBoundingClientRect ( ) . height ;
172+ } ;
173+ return {
174+ checkbox : height ( '.field input[type="checkbox"]' ) ,
175+ radio : height ( '.field input[type="radio"]' ) ,
176+ select : height ( ".field select" ) ,
177+ text : height ( '.field input[type="text"]' ) ,
178+ } ;
179+ } ) ;
180+
181+ expect ( dimensions . text ) . toBe ( 38 ) ;
182+ expect ( dimensions . select ) . toBe ( 38 ) ;
183+ expect ( dimensions . checkbox ) . toBeLessThan ( 38 ) ;
184+ expect ( dimensions . radio ) . toBeLessThan ( 38 ) ;
185+ } finally {
186+ await closeMobileFixture ( fixture ) ;
187+ }
188+ } ) ;
158189} ) ;
0 commit comments