@@ -276,35 +276,35 @@ export function updateElementsVisibilityForOptions(
276276 // Check line before open wrapper
277277 if ( openIndex > 0 ) {
278278 const prevLine = allLines [ openIndex - 1 ] ;
279- const prevText = prevLine . textContent ?. trim ( ) ;
280- if ( ! prevText || prevText === '' ) {
281- prevLine . style . display = 'none ' ;
279+ if ( ! prevLine . textContent ?. trim ( ) ) {
280+ prevLine . classList . add ( 'hidden' ) ;
281+ prevLine . dataset . emptyLineHidden = 'true ' ;
282282 }
283283 }
284284
285285 // Check line after close wrapper
286286 if ( closeIndex < allLines . length - 1 ) {
287287 const nextLine = allLines [ closeIndex + 1 ] ;
288- const nextText = nextLine . textContent ?. trim ( ) ;
289- if ( ! nextText || nextText === '' ) {
290- nextLine . style . display = 'none ' ;
288+ if ( ! nextLine . textContent ?. trim ( ) ) {
289+ nextLine . classList . add ( 'hidden' ) ;
290+ nextLine . dataset . emptyLineHidden = 'true ' ;
291291 }
292292 }
293293 } else {
294294 // Show empty lines when integrations are visible
295295 if ( openIndex > 0 ) {
296296 const prevLine = allLines [ openIndex - 1 ] ;
297- const prevText = prevLine . textContent ?. trim ( ) ;
298- if ( ! prevText || prevText === '' ) {
299- prevLine . style . display = '' ;
297+ if ( prevLine . dataset . emptyLineHidden === 'true' ) {
298+ prevLine . classList . remove ( 'hidden' ) ;
299+ delete prevLine . dataset . emptyLineHidden ;
300300 }
301301 }
302302
303303 if ( closeIndex < allLines . length - 1 ) {
304304 const nextLine = allLines [ closeIndex + 1 ] ;
305- const nextText = nextLine . textContent ?. trim ( ) ;
306- if ( ! nextText || nextText === '' ) {
307- nextLine . style . display = '' ;
305+ if ( nextLine . dataset . emptyLineHidden === 'true' ) {
306+ nextLine . classList . remove ( 'hidden' ) ;
307+ delete nextLine . dataset . emptyLineHidden ;
308308 }
309309 }
310310 }
0 commit comments