This PR is a simple fix for #1061. Currently when ignore-tabbable.js switches focus to a new element, the contents of the new element is not highlighted breaking the default web browser behaviour.
This PR checked to see if the element just focused has a "select" method, and if so calls it to select the contents of the newly focused element. Select boxes and buttons don't have a selection and therefore we shouldn't just blindly call select() on everything.
Thank you for your contribution, @jimohalloran.
The team will review your PR in the scope of the above bug fix and merge if it suits.
Internal ticket id BB-20605.
This PR is a simple fix for #1061. Currently when ignore-tabbable.js switches focus to a new element, the contents of the new element is not highlighted breaking the default web browser behaviour.
This PR checked to see if the element just focused has a "select" method, and if so calls it to select the contents of the newly focused element. Select boxes and buttons don't have a selection and therefore we shouldn't just blindly call
select()
on everything.