BlockNote Accessibility Diff Lab · static issue comparator

BlockNote accessibility issue comparator

Choose a reported issue to see what to test, what should change, and whether a fix is available.

Loading…

Editor theme
Frame width

Validate this issue

Do this

    What you should see

    Current behavior, the expected result, and what you observed
    CheckCurrentExpectedObserved

    Observations and notes are saved in this browser. Use Download observations to export a build-stamped JSON record.

    After (both fixes)

    Open after in a new window

    Keyboard focus: not in a preview control.

    What this compares

    Both frames are built from the same BlockNote source and the same two-paragraph fixture. Before is the unmodified baseline; After can be switched between the combined patch and each isolated file. This shows which change fixes focus and which fixes activation.

    The problem

    With the side menu showing and the caret in a block, Tab can focus a cloned Add block button from the closing transition. That copy has no React handlers; Enter and Space do nothing, and about 250 ms later it is removed and focus falls to the document body. The live Add block button also ignores Enter and Space because its click handler is on the icon.

    Important: the static build does not emulate forced colours or CDP media preferences. Use the local Diff Lab for forced-colours light/dark, reduced motion, capture and controlled Chromium. The theme buttons here force the editor’s Mantine theme; they do not claim to reproduce OS contrast themes.

    What differs in the built editor

    diff --git a/packages/react/src/components/Popovers/GenericPopover.tsx b/packages/react/src/components/Popovers/GenericPopover.tsx
    index 2eb5808..80ab35b 100644
    --- a/packages/react/src/components/Popovers/GenericPopover.tsx
    +++ b/packages/react/src/components/Popovers/GenericPopover.tsx
    @@ -235,13 +235,19 @@ export const GenericPopover = (
           return;
         }
     
    +    const wrapper = ref.current;
    +    // The snapshot is only for the closing transition. It must never become
    +    // a tab stop after the live popover has closed: Tab can otherwise focus
    +    // a button inside the copy, which is then removed and drops focus.
    +    wrapper.setAttribute("inert", "");
         const nodes = [...snapshot.current];
    -    ref.current.append(...nodes);
    +    wrapper.append(...nodes);
     
         return () => {
           for (const node of nodes) {
             node.parentNode?.removeChild(node);
           }
    +      wrapper.removeAttribute("inert");
         };
       }, [status]);
     
    diff --git a/packages/react/src/components/SideMenu/DefaultButtons/AddBlockButton.tsx b/packages/react/src/components/SideMenu/DefaultButtons/AddBlockButton.tsx
    index ac1209f..26fc8bc 100644
    --- a/packages/react/src/components/SideMenu/DefaultButtons/AddBlockButton.tsx
    +++ b/packages/react/src/components/SideMenu/DefaultButtons/AddBlockButton.tsx
    @@ -55,9 +55,8 @@ export const AddBlockButton = () => {
         <Components.SideMenu.Button
           className={"bn-button"}
           label={dict.side_menu.add_block_label}
    -      icon={
    -        <AiOutlinePlus size={24} onClick={onClick} data-test="dragHandleAdd" />
    -      }
    +      onClick={onClick}
    +      icon={<AiOutlinePlus size={24} data-test="dragHandleAdd" />}
         />
       );
     };
    

    Limits and provenance