Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-78324 theme_boost: Only shift focus if origin focus unchanged
In the Moodle additions for the Bootstrap Dropdown we update the focus after a 50ms delay. This is presumably because the targetted focus point may not have shown yet and may be opened in a separate thread, though sadly the original reasoning is not documented, and is not mentioned in the original issues. As a result of this delay, it was possible for the user to start to interact and then have focus stolen from them. In reality this does not happen often - 50ms is simply too short a time for a human to do so, but it is plenty of time for Behat to do so and we have seen some random fails as other parts of the UI become faster. When this happens, keyboard focus tests are broken by this 50ms behaviour. The fix here updates the shift focus function when closing the menu to check whether the focus has changed from the previous location already before setting the focus.
- Loading branch information