Skip to content

IE 11: sibling inserter doesn't appear, breaking keyboard navigation #3408

Closed

Description

@afercia

With IE 11, tabbing from one block to the following block doesn't make the "sibling" inserter button appear. Tabbing again, focus is lost and the tab sequence starts from scratch from the document root.

This makes impossible to tab through blocks, since focus constantly fallbacks to the document root.

Happens also when tabbing from the title to the following block. To reproduce:

screenshot 105

  • 1: click on the title
  • 2: press Tab (seems focus goes somewhere and then is lost immediately)
  • 3: press Tab: focus starts from scratch from the skip link

Dumping something in the console to check when the relevant functions run:

Chrome macOS: Not sure why they run multiple times after a single Tab press (maybe because it re-renders?)

screen shot 2017-11-09 at 15 27 40

IE 11:

screenshot 106

isVisible is false

Activity

  1. added
    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).
    [Type] BugAn existing feature does not function as intended
    on Nov 9, 2017
  2. ephox-mogran commented on Nov 10, 2017

    @ephox-mogran
    Contributor

    This is caused by the onBlur handler in SiblingInserter. The div gets focused, and then immediately focuses the button inside. That fires a blur on the div, which calls hide.

    Note, this seems to be resolved by just ensuring that the newly focused item (document.activeElement) isn't contained by the div before firing hide. It seems to work on all browsers from some cursory testing, but if we hit problems, we might need to use the withFocusOutside HOC again.

  3. ephox-mogran commented on Nov 10, 2017

    @ephox-mogran
    Contributor

    Note, that I needed the PR #3415 to even begin debugging this. I'm not sure how you were able to get so far @afercia ! :) My Gutenberg just kept crashing due to the startsWith issue.

  4. afercia commented on Nov 10, 2017

    @afercia
    ContributorAuthor

    I'm not sure how you were able to get so far

    Old-school methods 😬

    I was wondering why there's the need of the wrapper div and the focus management in the first place. Wouldn't be simpler to have the sibling inserter button always rendered and visually hidden? There are simple CSS techniques to visually hide elements and still keep them focusable. On focus, just a className update can reveal the element. Something like the row action links in the WordPress list tables.

  5. aduth commented on Nov 13, 2017

    @aduth
    Member

    I was wondering why there's the need of the wrapper div and the focus management in the first place.

    Originally this was intended as an optimization to avoid unnecessary DOM nodes, since a between-inserter-per-block could lead to an excessive number of nodes and therefore potential for a performance impact. However, given that as implemented, the Inserter component contains its own logic for rendering only when open and is otherwise limited to a single node, there really may not be need for this after-all and could be simplified.

  6. ephox-mogran commented on Nov 14, 2017

    @ephox-mogran
    Contributor

    So is this the simplification we want:

    • Basic empty DIV that is focusable when it is not focused or visible
    • Unwrapped Inserter dropdown button when it is visible / focused

    I've also noticed that it seems like moving the mouse can make the inserter button disappear, even when it is focused. I assume that's not desired behaviour?

  7. afercia commented on Nov 15, 2017

    @afercia
    ContributorAuthor

    Hm couldn't this be done with just CSS? Not sure why there's the need of a focusable empty DIV.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Focus] Accessibility (a11y)Changes that impact accessibility and need corresponding review (e.g. markup changes).[Type] BugAn existing feature does not function as intended

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions