VE-1046: Fix by applying change from upstream: https://github.com/wikimedia/oojs-ui/commit/6d780210a6d3c679eab48eedaa4d5872a518999a