File tree Expand file tree Collapse file tree
src/frontendHighlighterApp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -296,6 +296,14 @@ class AccessibilityCheckerHighlight {
296296 document . body . append ( tooltip ) ;
297297
298298 const updatePosition = function ( ) {
299+ // Find existing tooltips for the same element to calculate inline positioning
300+ const existingTooltips = Array . from ( document . querySelectorAll ( '.edac-highlight-btn' ) ) . filter ( ( btn ) => {
301+ // Check if this tooltip targets the same element by comparing their positioning reference
302+ return btn !== tooltip && btn . dataset . targetElement === element . outerHTML . replace ( / \W / g, '' ) ;
303+ } ) ;
304+
305+ const tooltipOffset = existingTooltips . length ;
306+
299307 computePosition ( element , tooltip , {
300308 placement : 'top-start' ,
301309 middleware : [ ] ,
@@ -307,7 +315,7 @@ class AccessibilityCheckerHighlight {
307315 const tooltipWidth = tooltip . offsetWidth === undefined ? 0 : tooltip . offsetWidth ;
308316
309317 let top = 0 ;
310- const left = 0 ;
318+ const left = tooltipOffset * ( tooltipWidth + 5 ) ; // 5px gap between buttons
311319
312320 if ( tooltipHeight <= ( elHeight * .8 ) ) {
313321 top = tooltipHeight ;
@@ -336,6 +344,9 @@ class AccessibilityCheckerHighlight {
336344 } ) ;
337345 } ;
338346
347+ // Store reference to target element for positioning calculations
348+ tooltip . dataset . targetElement = element . outerHTML . replace ( / \W / g, '' ) ;
349+
339350 // Place the tooltip at the element's position on the page.
340351 // See: https://floating-ui.com/docs/autoUpdate
341352 const cleanup = autoUpdate (
You can’t perform that action at this time.
0 commit comments