Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavigableContainer: Items in TabbableContainer are not navigated in order #8563

Closed
mmtr opened this issue Aug 5, 2018 · 4 comments
Closed
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended

Comments

@mmtr
Copy link
Contributor

mmtr commented Aug 5, 2018

Describe the bug
When rendering a TabbableContainer component outside Gutenberg, the items are not navigated in order when pressing the tab key.

The menu navigates from the Section 1 to the Section 3 and from the Section 2 to the Section 4.

To Reproduce
Execute the code below in a new React project after installing @wordpress/components.

import React from 'react';
import ReactDOM from 'react-dom';
import { TabbableContainer, Button } from '@wordpress/components';

import '@wordpress/components/build-style/styles.css';

const MyTabbableContainer = () => (
	<TabbableContainer onNavigate={ onNavigate }>
		<Button isDefault tabIndex="0">Section 1</Button>
		<Button isDefault tabIndex="0">Section 2</Button>
		<Button isDefault tabIndex="0">Section 3</Button>
		<Button isDefault tabIndex="0">Section 4</Button>
	</TabbableContainer>
);

ReactDOM.render(
	<MyTabbableContainer />,
	document.getElementById( 'root' )
);

Expected behavior
The menu navigates from the Section 1 to the Section 2 and from the Section 2 to the Section 3.

Screenshots
aug-05-2018 23-22-22

Desktop:

  • OS: macOS High Sierra
  • Browser: Chrome
  • Version: 67

Additional context
Issue found while working on #8338 and Automattic/wp-calypso#26367

@designsimply designsimply added [Feature] Extensibility The ability to extend blocks or the editing experience Needs Testing Needs further testing to be confirmed. labels Aug 7, 2018
@aduth
Copy link
Member

aduth commented Oct 30, 2018

TabbableContainer is meant to manage key events on your behalf. Have you tried omitting tabIndex?

Even if that works, TabbableContainer should at worst be preventing the default browser behavior to avoid the double-skip.

@aduth aduth added [Type] Bug An existing feature does not function as intended [Feature] UI Components Impacts or related to the UI component system and removed [Feature] Extensibility The ability to extend blocks or the editing experience Needs Testing Needs further testing to be confirmed. labels Oct 30, 2018
@tn3rb
Copy link

tn3rb commented Oct 15, 2019

wow this is old...
can confirm that the TabbableContainer jumps to every other item upon tabbing.
removing tabIndex had no effect and did not prevent the double-skip.

@paaljoachim
Copy link
Contributor

How should we move this old issue forward?
@mcsf @ockham

@mcsf
Copy link
Contributor

mcsf commented Feb 23, 2021

Closing until someone can fix this. If it's not impacting usage within Gutenberg, it can't be prioritised. There are also opportunities with the partial adoption of Reakit, as well as the new Components project, to see this component superseded by better solutions.

@mcsf mcsf closed this as completed Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] UI Components Impacts or related to the UI component system [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants