You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the <Overlay2> component with isOpen={true}, a 2px blue line (focus outline) appears at the top of the page during the initial render, before any user interaction (e.g., clicks). This happens even though FocusStyleManager.onlyShowFocusOnTabs() is present.
The problem seems to stem from FocusStyleManager only initializing and applying the .bp5-focus-disabled class to the root document after the first mousedown interaction. Until then, focus styles are still applied to focused elements.
Load the page:
Load the page without any prior interaction (do not click or tap).
Observe the issue:
Notice a blue focus outline at the top of the page.
Tip: To reproduce the issue more reliably, enable "Emulate a focused page" in Chrome DevTools:
Open DevTools
Go to Rendering tab
Check Emulate a focused page
Expected behavior
The focus outline (blue border) should not be displayed upon initial render due to FocusStyleManager.onlyShowFocusOnTabs(), which should suppress focus styles unless the user is navigating via keyboard.
Actual behavior
A blue focus outline appears at the top of the page on initial load before any user interaction.
Screenshots:
Focus outline visible at the top:
Possible solution
Adjust FocusStyleManager to apply the .bp5-focus-disabled class to the document immediately on page load, not after the first mousedown event.
The text was updated successfully, but these errors were encountered:
Description
When using the
<Overlay2>
component withisOpen={true}
, a 2px blue line (focus outline) appears at the top of the page during the initial render, before any user interaction (e.g., clicks). This happens even thoughFocusStyleManager.onlyShowFocusOnTabs()
is present.Example Code:
The problem seems to stem from
FocusStyleManager
only initializing and applying the.bp5-focus-disabled
class to the root document after the first mousedown interaction. Until then, focus styles are still applied to focused elements.blueprint/packages/core/src/common/interactionMode.ts
Lines 38 to 40 in 9c16d3a
Environment
5.16.4
Chrome 131.0.6778.265
Code Sandbox
Minimal repro here (visible in debug preview)
Steps to reproduce
Set up FocusStyleManager:
Include
FocusStyleManager.onlyShowFocusOnTabs()
in your application.Render Overlay2:
Render an
<Overlay2>
component withisOpen={true}
:Load the page:
Load the page without any prior interaction (do not click or tap).
Observe the issue:
Notice a blue focus outline at the top of the page.
Expected behavior
The focus outline (blue border) should not be displayed upon initial render due to
FocusStyleManager.onlyShowFocusOnTabs()
, which should suppress focus styles unless the user is navigating via keyboard.Actual behavior
A blue focus outline appears at the top of the page on initial load before any user interaction.
Screenshots:
Focus outline visible at the top:
Possible solution
Adjust
FocusStyleManager
to apply the.bp5-focus-disabled
class to the document immediately on page load, not after the first mousedown event.The text was updated successfully, but these errors were encountered: