Browse Source

Add span between synctex button and tooltip (#25475)

GitOrigin-RevId: d1e7c71597566f916a9432d9114def791cf25fa8
Alf Eaton 1 year ago
parent
commit
60cdd252ef

+ 26 - 22
services/web/frontend/js/features/pdf-preview/components/pdf-synctex-controls.tsx

@@ -57,17 +57,19 @@ const GoToCodeButton = memo(function GoToCodeButton({
       description={t('go_to_pdf_location_in_code')}
       overlayProps={overlayProps}
     >
-      <OLButton
-        variant="secondary"
-        size="sm"
-        onClick={syncToCodeWithButton}
-        disabled={syncToCodeInFlight}
-        className={buttonClasses}
-        aria-label={t('go_to_pdf_location_in_code')}
-      >
-        {buttonIcon}
-        {isDetachLayout ? <span>&nbsp;{t('show_in_code')}</span> : ''}
-      </OLButton>
+      <span>
+        <OLButton
+          variant="secondary"
+          size="sm"
+          onClick={syncToCodeWithButton}
+          disabled={syncToCodeInFlight}
+          className={buttonClasses}
+          aria-label={t('go_to_pdf_location_in_code')}
+        >
+          {buttonIcon}
+          {isDetachLayout ? <span>&nbsp;{t('show_in_code')}</span> : ''}
+        </OLButton>
+      </span>
     </OLTooltip>
   )
 })
@@ -106,17 +108,19 @@ const GoToPdfButton = memo(function GoToPdfButton({
       description={t('go_to_code_location_in_pdf')}
       overlayProps={{ placement: tooltipPlacement }}
     >
-      <OLButton
-        variant="secondary"
-        size="sm"
-        onClick={syncToPdf}
-        disabled={syncToPdfInFlight || !canSyncToPdf}
-        className={buttonClasses}
-        aria-label={t('go_to_code_location_in_pdf')}
-      >
-        {buttonIcon}
-        {isDetachLayout ? <span>&nbsp;{t('show_in_pdf')}</span> : ''}
-      </OLButton>
+      <span>
+        <OLButton
+          variant="secondary"
+          size="sm"
+          onClick={syncToPdf}
+          disabled={syncToPdfInFlight || !canSyncToPdf}
+          className={buttonClasses}
+          aria-label={t('go_to_code_location_in_pdf')}
+        >
+          {buttonIcon}
+          {isDetachLayout ? <span>&nbsp;{t('show_in_pdf')}</span> : ''}
+        </OLButton>
+      </span>
     </OLTooltip>
   )
 })