Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ignore titles in menu, if they exist.
This is because of the change in videojs#3163 where we added the title as an item in the childrens array so that it is ordered correctly but this breaks keyboard support because they expect the children to be lined up correctly and also because they expect the children to be component objects with an 'el_' property. Checking to see if the first item is a 'vjs-menu-title' and adding one to the 'item' allows us to ignore the title element and also select the actual menu items.
- Loading branch information
6cb7b9f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically there could be a title and no other children, in which case
children[item].el_.focus()
would still throw an error.And if we're going to check if
children[item].el_
exists, then we could use that as the test for a title too, right?