Closed qqiao closed 8 years ago
Upon more investigation, I think the issue is with _onFocus, specifically around line 269.
In _onFocus, we check if there's 1 item, we'll then call _focusNext, which will skip over that item, thus in the case of a 1 item menu, nothing will gain initial focus.
Fixed by #67; released as v1.1.8 .
Description
_focusNext & _focusPrevious will skip if the menu has only 1 item If an element that uses IronMenuBehavior has only one child item, and the item isn't focused or selected initially, then there is no way that the user can focus the item using up/down keys.
Expected outcome
User will still be able to focus the item even if it is a 1 item menu
Actual outcome
On single item menus, the sole item cannot be focused by keyboard input
Live Demo
Steps to reproduce
The reason for this is because the loop counter of the the for-loop in both _focusNext and _focusPrevious starts at 1, so if there's only 1 item, it will never get focused.
Browsers Affected